Skip to content

Commit

Permalink
Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinglykrab committed Oct 6, 2024
1 parent 00d72fd commit 3653ea6
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 26 deletions.
105 changes: 105 additions & 0 deletions zone/lua_iteminst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,96 @@ std::string Lua_ItemInst::GetItemLink()
return linker.GenerateLink();
}

void Lua_ItemInst::AddEvolveAmount(uint64 amount)
{
Lua_Safe_Call_Void();
self->SetEvolveAddToCurrentAmount(amount);
}

uint32 Lua_ItemInst::GetAugmentEvolveUniqueID(uint8 slot_id)
{
Lua_Safe_Call_Int();
return self->GetAugmentEvolveUniqueID(slot_id);
}

bool Lua_ItemInst::GetEvolveActivated()
{
Lua_Safe_Call_Bool();
return self->GetEvolveActivated();
}

uint64 Lua_ItemInst::GetEvolveAmount()
{
Lua_Safe_Call_Int();
return self->GetEvolveCurrentAmount();
}

uint32 Lua_ItemInst::GetEvolveCharacterID()
{
Lua_Safe_Call_Int();
return self->GetEvolveCharID();
}

bool Lua_ItemInst::GetEvolveEquipped()
{
Lua_Safe_Call_Bool();
return self->GetEvolveEquipped();
}

uint32 Lua_ItemInst::GetEvolveFinalItemID()
{
Lua_Safe_Call_Int();
return self->GetEvolveFinalItemID();
}

uint32 Lua_ItemInst::GetEvolveItemID()
{
Lua_Safe_Call_Int();
return self->GetEvolveItemID();
}

int8 Lua_ItemInst::GetEvolveLevel()
{
Lua_Safe_Call_Int();
return self->GetEvolveLvl();
}

uint32 Lua_ItemInst::GetEvolveLoreID()
{
Lua_Safe_Call_Int();
return self->GetEvolveLoreID();
}

float Lua_ItemInst::GetEvolveProgression()
{
Lua_Safe_Call_Real();
return self->GetEvolveProgression();
}

uint64 Lua_ItemInst::GetEvolveUniqueID()
{
Lua_Safe_Call_Int();
return self->GetEvolveUniqueID();
}

bool Lua_ItemInst::IsEvolving()
{
Lua_Safe_Call_Bool();
return self->IsEvolving();
}

void Lua_ItemInst::SetEvolveAmount(uint64 amount)
{
Lua_Safe_Call_Void();
self->SetEvolveCurrentAmount(amount);
}

void Lua_ItemInst::SetEvolveProgression(float amount)
{
Lua_Safe_Call_Void();
self->SetEvolveProgression(amount);
}

luabind::scope lua_register_iteminst() {
return luabind::class_<Lua_ItemInst>("ItemInst")
.def(luabind::constructor<>())
Expand All @@ -351,12 +441,14 @@ luabind::scope lua_register_iteminst() {
.property("null", &Lua_ItemInst::Null)
.property("valid", &Lua_ItemInst::Valid)
.def("AddExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::AddExp)
.def("AddEvolveAmount", (void(Lua_ItemInst::*)(uint64))&Lua_ItemInst::AddEvolveAmount)
.def("ClearTimers", (void(Lua_ItemInst::*)(void))&Lua_ItemInst::ClearTimers)
.def("Clone", (Lua_ItemInst(Lua_ItemInst::*)(void))&Lua_ItemInst::Clone)
.def("ContainsAugmentByID", (bool(Lua_ItemInst::*)(uint32))&Lua_ItemInst::ContainsAugmentByID)
.def("CountAugmentByID", (int(Lua_ItemInst::*)(uint32))&Lua_ItemInst::CountAugmentByID)
.def("DeleteCustomData", (void(Lua_ItemInst::*)(const std::string &))&Lua_ItemInst::DeleteCustomData)
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
.def("GetAugmentEvolveUniqueID", (uint32(Lua_ItemInst::*)(uint8))&Lua_ItemInst::GetAugmentEvolveUniqueID)
.def("GetAugmentIDs", (luabind::object(Lua_ItemInst::*)(lua_State*))&Lua_ItemInst::GetAugmentIDs)
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
Expand All @@ -365,6 +457,16 @@ luabind::scope lua_register_iteminst() {
.def("GetCustomData", (std::string(Lua_ItemInst::*)(const std::string &))&Lua_ItemInst::GetCustomData)
.def("GetCustomDataString", (std::string(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCustomDataString)
.def("GetExp", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetExp)
.def("GetEvolveActivated", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveActivated)
.def("GetEvolveAmount", (uint64(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveAmount)
.def("GetEvolveCharacterID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveCharacterID)
.def("GetEvolveEquipped", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveEquipped)
.def("GetEvolveFinalItemID", (uint64(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveFinalItemID)
.def("GetEvolveItemID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveItemID)
.def("GetEvolveLevel", (int8(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveLevel)
.def("GetEvolveLoreID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveLoreID)
.def("GetEvolveProgression", (float(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveProgression)
.def("GetEvolveUniqueID", (uint64(Lua_ItemInst::*)(void))&Lua_ItemInst::GetEvolveUniqueID)
.def("GetID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetID)
.def("GetItem", (Lua_Item(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItem)
.def("GetItem", (Lua_ItemInst(Lua_ItemInst::*)(uint8))&Lua_ItemInst::GetItem)
Expand All @@ -383,6 +485,7 @@ luabind::scope lua_register_iteminst() {
.def("IsAugmented", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmented)
.def("IsEquipable", (bool(Lua_ItemInst::*)(int16))&Lua_ItemInst::IsEquipable)
.def("IsEquipable", (bool(Lua_ItemInst::*)(uint16,uint16))&Lua_ItemInst::IsEquipable)
.def("IsEvolving", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsEvolving)
.def("IsExpendable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsExpendable)
.def("IsInstNoDrop", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsInstNoDrop)
.def("IsStackable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsStackable)
Expand All @@ -398,6 +501,8 @@ luabind::scope lua_register_iteminst() {
.def("SetCustomData", (void(Lua_ItemInst::*)(const std::string&,float))&Lua_ItemInst::SetCustomData)
.def("SetCustomData", (void(Lua_ItemInst::*)(const std::string&,int))&Lua_ItemInst::SetCustomData)
.def("SetCustomData", (void(Lua_ItemInst::*)(const std::string&,const std::string&))&Lua_ItemInst::SetCustomData)
.def("SetEvolveAmount", (void(Lua_ItemInst::*)(uint64))&Lua_ItemInst::SetEvolveAmount)
.def("SetEvolveProgression", (void(Lua_ItemInst::*)(float))&Lua_ItemInst::SetEvolveProgression)
.def("SetExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetExp)
.def("SetInstNoDrop", (void(Lua_ItemInst::*)(bool))&Lua_ItemInst::SetInstNoDrop)
.def("SetPrice", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetPrice)
Expand Down
15 changes: 15 additions & 0 deletions zone/lua_iteminst.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ class Lua_ItemInst : public Lua_Ptr<EQ::ItemInstance>
void ItemSay(const char* text, uint8 language_id);
luabind::object GetAugmentIDs(lua_State* L);
std::string GetItemLink();
void AddEvolveAmount(uint64 amount);
uint32 GetAugmentEvolveUniqueID(uint8 slot_id);
bool GetEvolveActivated();
uint64 GetEvolveAmount();
uint32 GetEvolveCharacterID();
bool GetEvolveEquipped();
uint32 GetEvolveFinalItemID();
uint32 GetEvolveItemID();
int8 GetEvolveLevel();
uint32 GetEvolveLoreID();
float GetEvolveProgression();
uint64 GetEvolveUniqueID();
bool IsEvolving();
void SetEvolveAmount(uint64 amount);
void SetEvolveProgression(float amount);

private:
bool cloned_;
Expand Down
52 changes: 26 additions & 26 deletions zone/perl_questitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,64 +292,69 @@ std::string Perl_QuestItem_GetItemLink(EQ::ItemInstance* self)
return linker.GenerateLink();
}

int8 Perl_QuestItem_GetEvolveLevel(EQ::ItemInstance* self)
void Perl_QuestItem_AddEvolveAmount(EQ::ItemInstance* self, uint64 amount)
{
return self->GetEvolveLvl();
self->SetEvolveAddToCurrentAmount(amount);
}

bool Perl_QuestItem_IsEvolving(EQ::ItemInstance* self)
uint32 Perl_QuestItem_GetAugmentEvolveUniqueID(EQ::ItemInstance* self, uint8 slot_id)
{
return self->IsEvolving();
return self->GetAugmentEvolveUniqueID(slot_id);
}

bool Perl_QuestItem_GetEvolveActivated(EQ::ItemInstance* self)
{
return self->GetEvolveActivated();
}

bool Perl_QuestItem_GetEvolveEquipped(EQ::ItemInstance* self)
uint64 Perl_QuestItem_GetEvolveAmount(EQ::ItemInstance* self)
{
return self->GetEvolveEquipped();
return self->GetEvolveCurrentAmount();
}

double Perl_QuestItem_GetEvolveProgression(EQ::ItemInstance* self)
uint32 Perl_QuestItem_GetEvolveCharacterID(EQ::ItemInstance* self)
{
return self->GetEvolveProgression();
return self->GetEvolveCharID();
}

uint64 Perl_QuestItem_GetEvolveUniqueID(EQ::ItemInstance* self)
bool Perl_QuestItem_GetEvolveEquipped(EQ::ItemInstance* self)
{
return self->GetEvolveUniqueID();
return self->GetEvolveEquipped();
}

uint32 Perl_QuestItem_GetEvolveCharacterID(EQ::ItemInstance* self)
uint32 Perl_QuestItem_GetEvolveItemID(EQ::ItemInstance* self)
{
return self->GetEvolveCharID();
return self->GetEvolveItemID();
}

uint32 Perl_QuestItem_GetEvolveItemID(EQ::ItemInstance* self)
uint32 Perl_QuestItem_GetEvolveFinalItemID(EQ::ItemInstance* self)
{
return self->GetEvolveItemID();
return self->GetEvolveFinalItemID();
}

int8 Perl_QuestItem_GetEvolveLevel(EQ::ItemInstance* self)
{
return self->GetEvolveLvl();
}

uint32 Perl_QuestItem_GetEvolveLoreID(EQ::ItemInstance* self)
{
return self->GetEvolveLoreID();
}

uint64 Perl_QuestItem_GetEvolveCurrentAmount(EQ::ItemInstance* self)
double Perl_QuestItem_GetEvolveProgression(EQ::ItemInstance* self)
{
return self->GetEvolveCurrentAmount();
return self->GetEvolveProgression();
}

uint32 Perl_QuestItem_GetEvolveFinalItemID(EQ::ItemInstance* self)
uint64 Perl_QuestItem_GetEvolveUniqueID(EQ::ItemInstance* self)
{
return self->GetEvolveFinalItemID();
return self->GetEvolveUniqueID();
}

uint32 Perl_QuestItem_GetAugmentEvolveUniqueID(EQ::ItemInstance* self, uint8 slot_id)
bool Perl_QuestItem_IsEvolving(EQ::ItemInstance* self)
{
return self->GetAugmentEvolveUniqueID(slot_id);
return self->IsEvolving();
}

void Perl_QuestItem_SetEvolveProgression(EQ::ItemInstance* self, float amount)
Expand All @@ -362,11 +367,6 @@ void Perl_QuestItem_SetEvolveAmount(EQ::ItemInstance* self, uint64 amount)
self->SetEvolveCurrentAmount(amount);
}

void Perl_QuestItem_AddEvolveAmount(EQ::ItemInstance* self, uint64 amount)
{
self->SetEvolveAddToCurrentAmount(amount);
}


void perl_register_questitem()
{
Expand All @@ -390,8 +390,8 @@ void perl_register_questitem()
package.add("GetCustomData", &Perl_QuestItem_GetCustomData);
package.add("GetCustomDataString", &Perl_QuestItem_GetCustomDataString);
package.add("GetEvolveActivated", &Perl_QuestItem_GetEvolveActivated);
package.add("GetEvolveAmount", &Perl_QuestItem_GetEvolveAmount);
package.add("GetEvolveCharacterID", &Perl_QuestItem_GetEvolveCharacterID);
package.add("GetEvolveCurrentAmount", &Perl_QuestItem_GetEvolveCurrentAmount);
package.add("GetEvolveEquipped", &Perl_QuestItem_GetEvolveEquipped);
package.add("GetEvolveFinalItemID", &Perl_QuestItem_GetEvolveFinalItemID);
package.add("GetEvolveItemID", &Perl_QuestItem_GetEvolveItemID);
Expand Down

0 comments on commit 3653ea6

Please sign in to comment.