From 49c3a81e1850856d5e8bb990b0e7b32b87f5043d Mon Sep 17 00:00:00 2001 From: KimLS Date: Mon, 27 May 2013 17:24:31 -0700 Subject: [PATCH] More lua work, client should be completely exported barring any more bugs that crop up. Starting work on getting the rest of the general functions --- common/eq_constants.h | 2 +- zone/CMakeLists.txt | 2 + zone/QuestInterface.h | 1 + zone/QuestParserCollection.cpp | 8 + zone/QuestParserCollection.h | 1 + zone/lua_client.cpp | 176 +++++++- zone/lua_client.h | 90 +++-- zone/lua_general.cpp | 707 ++++++++++++++++++++++++++++++++- zone/lua_hate_entry.cpp | 22 + zone/lua_hate_entry.h | 3 + zone/lua_parser.cpp | 22 +- zone/lua_parser.h | 1 + zone/lua_parser_events.cpp | 118 +----- zone/questmgr.cpp | 4 +- zone/zone.cpp | 2 +- 15 files changed, 1010 insertions(+), 149 deletions(-) diff --git a/common/eq_constants.h b/common/eq_constants.h index bc0c16857..9f77c0bda 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -651,7 +651,7 @@ enum InventorySlot // Slot used in OP_TradeSkillCombine for world tradeskill containers SLOT_TRADESKILL = 1000, SLOT_AUGMENT = 1001, - // SLOT_POWER_SOURCE = 9999, + SLOT_POWER_SOURCE = 9999, // Value recognized by client for destroying an item SLOT_INVALID = (int16)0xFFFF }; diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 63e346662..46f03c570 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -136,6 +136,8 @@ SET(zone_headers lua_client.h lua_entity.h lua_general.h + lua_hate_entry.h + lua_hate_list.h lua_item.h lua_iteminst.h lua_mob.h diff --git a/zone/QuestInterface.h b/zone/QuestInterface.h index 38926eff5..a1ccd7b64 100644 --- a/zone/QuestInterface.h +++ b/zone/QuestInterface.h @@ -58,6 +58,7 @@ public: virtual void AddVar(std::string name, std::string val) { } virtual std::string GetVar(std::string name) { return std::string(); } + virtual void Init() { } virtual void ReloadQuests() { } virtual uint32 GetIdentifier() = 0; diff --git a/zone/QuestParserCollection.cpp b/zone/QuestParserCollection.cpp index 2262880be..614d397f6 100644 --- a/zone/QuestParserCollection.cpp +++ b/zone/QuestParserCollection.cpp @@ -53,6 +53,14 @@ void QuestParserCollection::AddVar(std::string name, std::string val) { } } +void QuestParserCollection::Init() { + std::list::iterator iter = _load_precedence.begin(); + while(iter != _load_precedence.end()) { + (*iter)->Init(); + iter++; + } +} + void QuestParserCollection::ReloadQuests(bool reset_timers) { if(reset_timers) { quest_manager.ClearAllTimers(); diff --git a/zone/QuestParserCollection.h b/zone/QuestParserCollection.h index c2647a21a..ffafafb3c 100644 --- a/zone/QuestParserCollection.h +++ b/zone/QuestParserCollection.h @@ -41,6 +41,7 @@ public: void RegisterQuestInterface(QuestInterface *qi, std::string ext); void AddVar(std::string name, std::string val); + void Init(); void ReloadQuests(bool reset_timers = true); bool HasQuestSub(uint32 npcid, const char *subname); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 9aeccedb9..8c5121434 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -18,6 +18,11 @@ void Lua_Client::SendSound() { self->SendSound(); } +void Lua_Client::Save() { + Lua_Safe_Call_Void(); + self->Save(); +} + void Lua_Client::Save(int commit_now) { Lua_Safe_Call_Void(); self->Save(commit_now); @@ -193,46 +198,106 @@ void Lua_Client::SetDeity(int v) { self->SetDeity(v); } +void Lua_Client::AddEXP(uint32 add_exp) { + Lua_Safe_Call_Void(); + self->AddEXP(add_exp); +} + +void Lua_Client::AddEXP(uint32 add_exp, int conlevel) { + Lua_Safe_Call_Void(); + self->AddEXP(add_exp, conlevel); +} + void Lua_Client::AddEXP(uint32 add_exp, int conlevel, bool resexp) { Lua_Safe_Call_Void(); self->AddEXP(add_exp, conlevel, resexp); } +void Lua_Client::SetEXP(uint32 set_exp, uint32 set_aaxp) { + Lua_Safe_Call_Void(); + self->SetEXP(set_exp, set_aaxp); +} + void Lua_Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp) { Lua_Safe_Call_Void(); self->SetEXP(set_exp, set_aaxp, resexp); } +void Lua_Client::SetBindPoint() { + Lua_Safe_Call_Void(); + self->SetBindPoint(); +} + +void Lua_Client::SetBindPoint(int to_zone) { + Lua_Safe_Call_Void(); + self->SetBindPoint(to_zone); +} + +void Lua_Client::SetBindPoint(int to_zone, float new_x) { + Lua_Safe_Call_Void(); + self->SetBindPoint(to_zone, new_x); +} + +void Lua_Client::SetBindPoint(int to_zone, float new_x, float new_y) { + Lua_Safe_Call_Void(); + self->SetBindPoint(to_zone, new_x, new_y); +} + void Lua_Client::SetBindPoint(int to_zone, float new_x, float new_y, float new_z) { Lua_Safe_Call_Void(); self->SetBindPoint(to_zone, new_x, new_y, new_z); } -float Lua_Client::GetBindX(int index) { +float Lua_Client::GetBindX() { Lua_Safe_Call_Real(); return self->GetBindX(); } -float Lua_Client::GetBindY(int index) { +float Lua_Client::GetBindX(int index) { + Lua_Safe_Call_Real(); + return self->GetBindX(index); +} + +float Lua_Client::GetBindY() { Lua_Safe_Call_Real(); return self->GetBindY(); } -float Lua_Client::GetBindZ(int index) { +float Lua_Client::GetBindY(int index) { + Lua_Safe_Call_Real(); + return self->GetBindY(index); +} + +float Lua_Client::GetBindZ() { Lua_Safe_Call_Real(); return self->GetBindZ(); } -float Lua_Client::GetBindHeading(int index) { +float Lua_Client::GetBindZ(int index) { + Lua_Safe_Call_Real(); + return self->GetBindZ(index); +} + +float Lua_Client::GetBindHeading() { Lua_Safe_Call_Real(); return self->GetBindHeading(); } -uint32 Lua_Client::GetBindZoneID(int index) { +float Lua_Client::GetBindHeading(int index) { + Lua_Safe_Call_Real(); + return self->GetBindHeading(index); +} + +uint32 Lua_Client::GetBindZoneID() { Lua_Safe_Call_Int(); return self->GetBindZoneID(); } +uint32 Lua_Client::GetBindZoneID(int index) { + Lua_Safe_Call_Int(); + return self->GetBindZoneID(index); +} + void Lua_Client::MovePC(int zone, float x, float y, float z, float heading) { Lua_Safe_Call_Void(); self->MovePC(zone, x, y, z, heading); @@ -303,6 +368,11 @@ int Lua_Client::GetFace() { return self->GetFace(); } +bool Lua_Client::TakeMoneyFromPP(uint64 copper) { + Lua_Safe_Call_Bool(); + return self->TakeMoneyFromPP(copper); +} + bool Lua_Client::TakeMoneyFromPP(uint64 copper, bool update_client) { Lua_Safe_Call_Bool(); return self->TakeMoneyFromPP(copper, update_client); @@ -328,11 +398,21 @@ void Lua_Client::SetSkillPoints(int skill) { self->SetSkillPoints(skill); } +void Lua_Client::IncreaseSkill(int skill_id) { + Lua_Safe_Call_Void(); + self->IncreaseSkill(skill_id); +} + void Lua_Client::IncreaseSkill(int skill_id, int value) { Lua_Safe_Call_Void(); self->IncreaseSkill(skill_id, value); } +void Lua_Client::IncreaseLanguageSkill(int skill_id) { + Lua_Safe_Call_Void(); + self->IncreaseLanguageSkill(skill_id); +} + void Lua_Client::IncreaseLanguageSkill(int skill_id, int value) { Lua_Safe_Call_Void(); self->IncreaseLanguageSkill(skill_id, value); @@ -368,6 +448,11 @@ void Lua_Client::CheckSpecializeIncrease(int spell_id) { self->CheckSpecializeIncrease(spell_id); } +void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target) { + Lua_Safe_Call_Void(); + self->CheckIncreaseSkill(static_cast(skill_id), target); +} + void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod) { Lua_Safe_Call_Void(); self->CheckIncreaseSkill(static_cast(skill_id), target, chance_mod); @@ -413,41 +498,81 @@ void Lua_Client::ResetAA() { self->ResetAA(); } +void Lua_Client::MemSpell(int spell_id, int slot) { + Lua_Safe_Call_Void(); + self->MemSpell(spell_id, slot); +} + void Lua_Client::MemSpell(int spell_id, int slot, bool update_client) { Lua_Safe_Call_Void(); self->MemSpell(spell_id, slot, update_client); } +void Lua_Client::UnmemSpell(int slot) { + Lua_Safe_Call_Void(); + self->UnmemSpell(slot); +} + void Lua_Client::UnmemSpell(int slot, bool update_client) { Lua_Safe_Call_Void(); self->UnmemSpell(slot, update_client); } +void Lua_Client::UnmemSpellAll() { + Lua_Safe_Call_Void(); + self->UnmemSpellAll(); +} + void Lua_Client::UnmemSpellAll(bool update_client) { Lua_Safe_Call_Void(); self->UnmemSpellAll(update_client); } +void Lua_Client::ScribeSpell(int spell_id, int slot) { + Lua_Safe_Call_Void(); + self->ScribeSpell(spell_id, slot); +} + void Lua_Client::ScribeSpell(int spell_id, int slot, bool update_client) { Lua_Safe_Call_Void(); self->ScribeSpell(spell_id, slot, update_client); } +void Lua_Client::UnscribeSpell(int slot) { + Lua_Safe_Call_Void(); + self->UnscribeSpell(slot); +} + void Lua_Client::UnscribeSpell(int slot, bool update_client) { Lua_Safe_Call_Void(); self->UnscribeSpell(slot, update_client); } +void Lua_Client::UnscribeSpellAll() { + Lua_Safe_Call_Void(); + self->UnscribeSpellAll(); +} + void Lua_Client::UnscribeSpellAll(bool update_client) { Lua_Safe_Call_Void(); self->UnscribeSpellAll(update_client); } +void Lua_Client::UntrainDisc(int slot) { + Lua_Safe_Call_Void(); + self->UntrainDisc(slot); +} + void Lua_Client::UntrainDisc(int slot, bool update_client) { Lua_Safe_Call_Void(); self->UntrainDisc(slot, update_client); } +void Lua_Client::UntrainDiscAll() { + Lua_Safe_Call_Void(); + self->UntrainDiscAll(); +} + void Lua_Client::UntrainDiscAll(bool update_client) { Lua_Safe_Call_Void(); self->UntrainDiscAll(update_client); @@ -513,6 +638,11 @@ int Lua_Client::GetAugmentIDAt(int slot_id, int aug_slot) { return self->GetAugmentIDAt(slot_id, aug_slot); } +void Lua_Client::DeleteItemInInventory(int slot_id, int quantity) { + Lua_Safe_Call_Void(); + self->DeleteItemInInventory(slot_id, quantity); +} + void Lua_Client::DeleteItemInInventory(int slot_id, int quantity, bool update_client) { Lua_Safe_Call_Void(); self->DeleteItemInInventory(slot_id, quantity, update_client); @@ -630,6 +760,11 @@ void Lua_Client::GoFish() { self->GoFish(); } +void Lua_Client::ForageItem() { + Lua_Safe_Call_Void(); + self->ForageItem(); +} + void Lua_Client::ForageItem(bool guarantee) { Lua_Safe_Call_Void(); self->ForageItem(guarantee); @@ -755,6 +890,21 @@ int Lua_Client::GetStartZone() { return self->GetStartZone(); } +void Lua_Client::SetStartZone(int zone_id) { + Lua_Safe_Call_Void(); + self->SetStartZone(zone_id); +} + +void Lua_Client::SetStartZone(int zone_id, float x) { + Lua_Safe_Call_Void(); + self->SetStartZone(zone_id, x); +} + +void Lua_Client::SetStartZone(int zone_id, float x, float y) { + Lua_Safe_Call_Void(); + self->SetStartZone(zone_id, x, y); +} + void Lua_Client::SetStartZone(int zone_id, float x, float y, float z) { Lua_Safe_Call_Void(); self->SetStartZone(zone_id, x, y, z); @@ -850,6 +1000,11 @@ uint32 Lua_Client::GetIP() { return self->GetIP(); } +void Lua_Client::AddLevelBasedExp(int exp_pct) { + Lua_Safe_Call_Void(); + self->AddLevelBasedExp(exp_pct); +} + void Lua_Client::AddLevelBasedExp(int exp_pct, int max_level) { Lua_Safe_Call_Void(); self->AddLevelBasedExp(exp_pct, max_level); @@ -860,11 +1015,21 @@ void Lua_Client::IncrementAA(int aa) { self->IncrementAA(aa); } +void Lua_Client::MarkSingleCompassLoc(float in_x, float in_y, float in_z) { + Lua_Safe_Call_Void(); + self->MarkSingleCompassLoc(in_x, in_y, in_z); +} + void Lua_Client::MarkSingleCompassLoc(float in_x, float in_y, float in_z, int count) { Lua_Safe_Call_Void(); self->MarkSingleCompassLoc(in_x, in_y, in_z, count); } +int Lua_Client::GetNextAvailableSpellBookSlot() { + Lua_Safe_Call_Int(); + return self->GetNextAvailableSpellBookSlot(); +} + int Lua_Client::GetNextAvailableSpellBookSlot(int start) { Lua_Safe_Call_Int(); return self->GetNextAvailableSpellBookSlot(start); @@ -1061,7 +1226,6 @@ luabind::scope lua_register_client() { .def("GetFace", (int(Lua_Client::*)(void))&Lua_Client::GetFace) .def("TakeMoneyFromPP", (bool(Lua_Client::*)(uint64))&Lua_Client::TakeMoneyFromPP) .def("TakeMoneyFromPP", (bool(Lua_Client::*)(uint64,bool))&Lua_Client::TakeMoneyFromPP) - .def("AddMoneyToPP", (void(Lua_Client::*)(uint32,uint32,uint32,uint32))&Lua_Client::AddMoneyToPP) .def("AddMoneyToPP", (void(Lua_Client::*)(uint32,uint32,uint32,uint32,bool))&Lua_Client::AddMoneyToPP) .def("TGB", (bool(Lua_Client::*)(void))&Lua_Client::TGB) .def("GetSkillPoints", (int(Lua_Client::*)(void))&Lua_Client::GetSkillPoints) diff --git a/zone/lua_client.h b/zone/lua_client.h index d441cd347..d642b152b 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -31,7 +31,8 @@ public: } void SendSound(); - void Save(int commit_now = 0); + void Save(); + void Save(int commit_now); void SaveBackup(); bool Connected(); bool InZone(); @@ -66,14 +67,26 @@ public: uint32 GetTotalSecondsPlayed(); void UpdateLDoNPoints(int points, uint32 theme); void SetDeity(int v); - void AddEXP(uint32 add_exp, int conlevel = 255, bool resexp = false); - void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp = false); - void SetBindPoint(int to_zone = -1, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f); - float GetBindX(int index = 0); - float GetBindY(int index = 0); - float GetBindZ(int index = 0); - float GetBindHeading(int index = 0); - uint32 GetBindZoneID(int index = 0); + void AddEXP(uint32 add_exp); + void AddEXP(uint32 add_exp, int conlevel); + void AddEXP(uint32 add_exp, int conlevel, bool resexp); + void SetEXP(uint32 set_exp, uint32 set_aaxp); + void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp); + void SetBindPoint(); + void SetBindPoint(int to_zone); + void SetBindPoint(int to_zone, float new_x); + void SetBindPoint(int to_zone, float new_x, float new_y); + void SetBindPoint(int to_zone, float new_x, float new_y, float new_z); + float GetBindX(); + float GetBindX(int index); + float GetBindY(); + float GetBindY(int index); + float GetBindZ(); + float GetBindZ(int index); + float GetBindHeading(); + float GetBindHeading(int index); + uint32 GetBindZoneID(); + uint32 GetBindZoneID(int index); void MovePC(int zone, float x, float y, float z, float heading); void MovePCInstance(int zone, int instance, float x, float y, float z, float heading); void ChangeLastName(const char *in); @@ -88,21 +101,24 @@ public: int GuildRank(); uint32 GuildID(); int GetFace(); - - bool TakeMoneyFromPP(uint64 copper, bool update_client = false); - void AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client = false); + bool TakeMoneyFromPP(uint64 copper); + bool TakeMoneyFromPP(uint64 copper, bool update_client); + void AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client); bool TGB(); int GetSkillPoints(); void SetSkillPoints(int skill); - void IncreaseSkill(int skill_id, int value = 1); - void IncreaseLanguageSkill(int skill_id, int value = 1); + void IncreaseSkill(int skill_id); + void IncreaseSkill(int skill_id, int value); + void IncreaseLanguageSkill(int skill_id); + void IncreaseLanguageSkill(int skill_id, int value); int GetRawSkill(int skill_id); bool HasSkill(int skill_id); bool CanHaveSkill(int skill_id); void SetSkill(int skill_id, int value); void AddSkill(int skill_id, int value); void CheckSpecializeIncrease(int spell_id); - void CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod = 0); + void CheckIncreaseSkill(int skill_id, Lua_Mob target); + void CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod); void SetLanguageSkill(int language, int value); int MaxSkill(int skill_id); bool IsMedding(); @@ -111,14 +127,22 @@ public: void SetDuelTarget(int c); void SetDueling(bool v); void ResetAA(); - void MemSpell(int spell_id, int slot, bool update_client = true); - void UnmemSpell(int slot, bool update_client = true); - void UnmemSpellAll(bool update_client = true); - void ScribeSpell(int spell_id, int slot, bool update_client = true); - void UnscribeSpell(int slot, bool update_client = true); - void UnscribeSpellAll(bool update_client = true); - void UntrainDisc(int slot, bool update_client = true); - void UntrainDiscAll(bool update_client = true); + void MemSpell(int spell_id, int slot); + void MemSpell(int spell_id, int slot, bool update_client); + void UnmemSpell(int slot); + void UnmemSpell(int slot, bool update_client); + void UnmemSpellAll(); + void UnmemSpellAll(bool update_client); + void ScribeSpell(int spell_id, int slot); + void ScribeSpell(int spell_id, int slot, bool update_client); + void UnscribeSpell(int slot); + void UnscribeSpell(int slot, bool update_client); + void UnscribeSpellAll(); + void UnscribeSpellAll(bool update_client); + void UntrainDisc(int slot); + void UntrainDisc(int slot, bool update_client); + void UntrainDiscAll(); + void UntrainDiscAll(bool update_client); bool IsSitting(); void SetFeigned(bool v); bool GetFeigned(); @@ -131,7 +155,8 @@ public: void Undye(); int GetItemIDAt(int slot_id); int GetAugmentIDAt(int slot_id, int aug_slot); - void DeleteItemInInventory(int slot_id, int quantity, bool update_client = true); + void DeleteItemInInventory(int slot_id, int quantity); + void DeleteItemInInventory(int slot_id, int quantity, bool update_client); void SummonItem(uint32 item_id); void SummonItem(uint32 item_id, int charges); void SummonItem(uint32 item_id, int charges, uint32 aug1); @@ -156,7 +181,8 @@ public: bool DecreaseByID(uint32 type, int amt); void Escape(); void GoFish(); - void ForageItem(bool guarantee = false); + void ForageItem(); + void ForageItem(bool guarantee); float CalcPriceMod(Lua_Mob other, bool reverse); void ResetTrade(); bool UseDiscipline(int spell_id, int target_id); @@ -181,7 +207,10 @@ public: int GetLDoNLossesTheme(int theme); Lua_ItemInst GetItemAt(int slot); int GetStartZone(); - void SetStartZone(int zone_id, float x = 0.0f, float y = 0.0f, float z = 0.0f); + void SetStartZone(int zone_id); + void SetStartZone(int zone_id, float x); + void SetStartZone(int zone_id, float x, float y); + void SetStartZone(int zone_id, float x, float y, float z); void KeyRingAdd(uint32 item); bool KeyRingCheck(uint32 item); void AddPVPPoints(uint32 points); @@ -200,10 +229,13 @@ public: void SetEndurance(int endur); void SendOPTranslocateConfirm(Lua_Mob caster, int spell_id); uint32 GetIP(); - void AddLevelBasedExp(int exp_pct, int max_level = 0); + void AddLevelBasedExp(int exp_pct); + void AddLevelBasedExp(int exp_pct, int max_level); void IncrementAA(int aa); - void MarkSingleCompassLoc(float in_x, float in_y, float in_z, int count = 1); - int GetNextAvailableSpellBookSlot(int start = 0); + void MarkSingleCompassLoc(float in_x, float in_y, float in_z); + void MarkSingleCompassLoc(float in_x, float in_y, float in_z, int count); + int GetNextAvailableSpellBookSlot(); + int GetNextAvailableSpellBookSlot(int start); int FindSpellBookSlotBySpellID(int spell_id); void UpdateTaskActivity(int task, int activity, int count); void AssignTask(int task, int npc_id); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index f3c3df6fc..e9b34c56c 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -207,6 +207,503 @@ Lua_Mob lua_spawn_from_spawn2(uint32 spawn2_id) { return Lua_Mob(quest_manager.spawn_from_spawn2(spawn2_id)); } +void lua_enable_spawn2() { + +} + +void lua_disable_spawn2() { + +} + +void lua_cast_spell() { + +} + +void lua_self_cast() { + +} + +void lua_set_timer() { + +} + +void lua_stop_timer() { + +} + +void lua_stop_all_timers() { + +} + +void lua_emote() { + +} + +void lua_shout() { + +} + +void lua_gmsay() { + +} + +void lua_depop() { + +} + +void lua_depop_with_timer() { + +} + +void lua_follow() { + +} + +void lua_stop_follow() { + +} + +void lua_change_deity() { + +} + +void lua_is_disc_tome() { + +} + +void lua_safe_move() { + +} + +void lua_rain() { + +} + +void lua_snow() { + +} + +void lua_surname() { + +} + +void lua_perma_class() { + +} + +void lua_perma_race() { + +} + +void lua_perma_gender() { + +} + +void lua_scribe_spells() { + +} + +void lua_train_discs() { + +} + +void lua_give_cash() { + +} + +void lua_move_group() { + +} + +void lua_faction() { + +} + +void lua_set_sky() { + +} + +void lua_set_guild() { + +} + +void lua_create_guild() { + +} + +void lua_set_time() { + +} + +void lua_signal() { + +} + +void lua_set_global() { + +} + +void lua_target_global() { + +} + +void lua_delete_global() { + +} + +void lua_ding() { + +} + +void lua_bind() { + +} + +void lua_start() { + +} + +void lua_stop() { + +} + +void lua_pause() { + +} + +void lua_move_to() { + +} + +void lua_path_resume() { + +} + +void lua_set_next_hp_event() { + +} + +void lua_set_next_inc_hp_event() { + +} + +void lua_respawn() { + +} + +void lua_choose_random() { + +} + +void lua_set_proximity() { + +} + +void lua_clear_proximity() { + +} + +void lua_enable_proximity_say() { + +} + +void lua_disable_proximity_say() { + +} + +void lua_set_anim() { + +} + +void lua_spawn_condition() { + +} + +void lua_get_spawn_condition() { + +} + +void lua_toggle_spawn_event() { + +} + +void lua_has_zone_flag() { + +} + +void lua_set_zone_flag() { + +} + +void lua_clear_zone_flag() { + +} + +void lua_summon_burried_player_corpse() { + +} + +void lua_summon_all_player_corpses() { + +} + +void lua_get_player_burried_corpse_count() { + +} + +void lua_bury_player_corpse() { + +} + +void lua_depop_all() { + +} + +void lua_depop_zone() { + +} + +void lua_repop_zone() { + +} + +void lua_task_selector() { + +} + +void lua_task_set_selector() { + +} + +void lua_enable_task() { + +} + +void lua_disable_task() { + +} + +void lua_is_task_enabled() { + +} + +void lua_is_task_active() { + +} + +void lua_is_task_activity_active() { + +} + +void lua_get_task_activity_done_count() { + +} + +void lua_update_task_activity() { + +} + +void lua_reset_task_activity() { + +} + +void lua_task_explored_area() { + +} + +void lua_assign_task() { + +} + +void lua_fail_task() { + +} + +void lua_task_time_left() { + +} + +void lua_is_task_completed() { + +} + +void lua_enabled_task_count() { + +} + +void lua_first_task_in_set() { + +} + +void lua_last_task_in_set() { + +} + +void lua_next_task_in_set() { + +} + +void lua_active_speak_task() { + +} + +void lua_active_speak_activity() { + +} + +void lua_active_tasks_in_set() { + +} + +void lua_completed_tasks_in_set() { + +} + +void lua_is_task_appropriate() { + +} + +void lua_popup() { + +} + +void lua_clear_spawn_timers() { + +} + +void lua_zone_emote() { + +} + +void lua_world_emote() { + +} + +void lua_get_level() { + +} + +void lua_create_ground_object() { + +} + +void lua_create_ground_object_from_model() { + +} + +void lua_create_door() { + +} + +void lua_modify_npc_stat() { + +} + +void lua_count_items() { + +} + +void lua_update_spawn_timer() { + +} + +void lua_merchant_set_item() { + +} + +void lua_merchant_count_item() { + +} + +void lua_item_link() { + +} + +void lua_say_link() { + +} + +void lua_get_guild_name_by_id() { + +} + +void lua_create_instance() { + +} + +void lua_destroy_instance() { + +} + +void lua_get_instance_id() { + +} + +void lua_assign_to_instance() { + +} + +void lua_assign_group_to_instance() { + +} + +void lua_assign_raid_to_instance() { + +} + +void lua_flag_instance_by_group_leader() { + +} + +void lua_flag_instance_by_raid_leader() { + +} + +void lua_fly_mode() { + +} + +void lua_faction_value() { + +} + +void lua_check_title() { + +} + +void lua_enable_title() { + +} + +void lua_remove_title() { + +} + +void lua_wear_change() { + +} + +void lua_voice_tell() { + +} + +void lua_send_mail() { + +} + +void lua_cross_zone_signal_client_by_char_id() { + +} + +void lua_cross_zone_signal_client_by_name() { + +} + +void lua_cross_zone_message_player_by_name() { + +} + + luabind::scope lua_register_general() { return luabind::namespace_("eq") [ @@ -228,7 +725,131 @@ luabind::scope lua_register_general() { luabind::def("spawn2", (Lua_Mob(*)(int,int,int,double,double,double,double))&lua_spawn2), luabind::def("unique_spawn", (Lua_Mob(*)(int,int,int,double,double,double))&lua_unique_spawn), luabind::def("unique_spawn", (Lua_Mob(*)(int,int,int,double,double,double,double))&lua_unique_spawn), - luabind::def("spawn_from_spawn2", (Lua_Mob(*)(uint32))&lua_spawn_from_spawn2) + luabind::def("spawn_from_spawn2", (Lua_Mob(*)(uint32))&lua_spawn_from_spawn2), + luabind::def("enable_spawn2", &lua_enable_spawn2), + luabind::def("disable_spawn2", &lua_disable_spawn2), + luabind::def("cast_spell", &lua_cast_spell), + luabind::def("self_cast", &lua_self_cast), + luabind::def("set_timer", &lua_set_timer), + luabind::def("stop_timer", &lua_stop_timer), + luabind::def("stop_all_timers", &lua_stop_all_timers), + luabind::def("emote", &lua_emote), + luabind::def("shout", &lua_shout), + luabind::def("gmsay", &lua_gmsay), + luabind::def("depop", &lua_depop), + luabind::def("depop_with_timer", &lua_depop_with_timer), + luabind::def("follow", &lua_follow), + luabind::def("stop_follow", &lua_stop_follow), + luabind::def("change_deity", &lua_change_deity), + luabind::def("is_disc_tome", &lua_is_disc_tome), + luabind::def("safe_move", &lua_safe_move), + luabind::def("rain", &lua_rain), + luabind::def("snow", &lua_snow), + luabind::def("surname", &lua_surname), + luabind::def("perma_class", &lua_perma_class), + luabind::def("perma_race", &lua_perma_race), + luabind::def("perma_gender", &lua_perma_gender), + luabind::def("scribe_spells", &lua_scribe_spells), + luabind::def("train_discs", &lua_train_discs), + luabind::def("give_cash", &lua_give_cash), + luabind::def("move_group", &lua_move_group), + luabind::def("faction", &lua_faction), + luabind::def("set_sky", &lua_set_sky), + luabind::def("set_guild", &lua_set_guild), + luabind::def("create_guild", &lua_create_guild), + luabind::def("set_time", &lua_set_time), + luabind::def("signal", &lua_signal), + luabind::def("set_global", &lua_set_global), + luabind::def("target_global", &lua_target_global), + luabind::def("delete_global", &lua_delete_global), + luabind::def("ding", &lua_ding), + luabind::def("bind", &lua_bind), + luabind::def("start", &lua_start), + luabind::def("stop", &lua_stop), + luabind::def("pause", &lua_pause), + luabind::def("move_to", &lua_move_to), + luabind::def("resume", &lua_path_resume), + luabind::def("set_next_hp_event", &lua_set_next_hp_event), + luabind::def("set_next_inc_hp_event", &lua_set_next_inc_hp_event), + luabind::def("respawn", &lua_respawn), + luabind::def("choose_random", &lua_choose_random), + luabind::def("set_proximity", &lua_set_proximity), + luabind::def("clear_proximity", &lua_clear_proximity), + luabind::def("enable_proximity_say", &lua_enable_proximity_say), + luabind::def("disable_proximity_say", &lua_disable_proximity_say), + luabind::def("set_anim", &lua_set_anim), + luabind::def("spawn_condition", &lua_spawn_condition), + luabind::def("get_spawn_condition", &lua_get_spawn_condition), + luabind::def("toggle_spawn_event", &lua_toggle_spawn_event), + luabind::def("has_zone_flag", &lua_has_zone_flag), + luabind::def("set_zone_flag", &lua_set_zone_flag), + luabind::def("clear_zone_flag", &lua_clear_zone_flag), + luabind::def("summon_burried_player_corpse", &lua_summon_burried_player_corpse), + luabind::def("summon_all_player_corpses", &lua_summon_all_player_corpses), + luabind::def("get_player_burried_corpse_count", &lua_get_player_burried_corpse_count), + luabind::def("bury_player_corpse", &lua_bury_player_corpse), + luabind::def("depop_all", &lua_depop_all), + luabind::def("depop_zone", &lua_depop_zone), + luabind::def("repop_zone", &lua_repop_zone), + luabind::def("task_selector", &lua_task_selector), + luabind::def("task_set_selector", &lua_task_set_selector), + luabind::def("enable_task", &lua_enable_task), + luabind::def("disable_task", &lua_disable_task), + luabind::def("is_task_enabled", &lua_is_task_enabled), + luabind::def("is_task_active", &lua_is_task_active), + luabind::def("is_task_activity_active", &lua_is_task_activity_active), + luabind::def("get_task_activity_done_count", &lua_get_task_activity_done_count), + luabind::def("update_task_activity", &lua_update_task_activity), + luabind::def("reset_task_activity", &lua_reset_task_activity), + luabind::def("task_explored_area", &lua_task_explored_area), + luabind::def("assign_task", &lua_assign_task), + luabind::def("fail_task", &lua_fail_task), + luabind::def("task_time_left", &lua_task_time_left), + luabind::def("is_task_completed", &lua_is_task_completed), + luabind::def("enabled_task_count", &lua_enabled_task_count), + luabind::def("first_task_in_set", &lua_first_task_in_set), + luabind::def("last_task_in_set", &lua_last_task_in_set), + luabind::def("next_task_in_set", &lua_next_task_in_set), + luabind::def("active_speak_task", &lua_active_speak_task), + luabind::def("active_speak_activity", &lua_active_speak_activity), + luabind::def("active_tasks_in_set", &lua_active_tasks_in_set), + luabind::def("completed_tasks_in_set", &lua_completed_tasks_in_set), + luabind::def("is_task_appropriate", &lua_is_task_appropriate), + luabind::def("popup", &lua_popup), + luabind::def("clear_spawn_timers", &lua_clear_spawn_timers), + luabind::def("zone_emote", &lua_zone_emote), + luabind::def("world_emote", &lua_world_emote), + luabind::def("get_level", &lua_get_level), + luabind::def("create_ground_object", &lua_create_ground_object), + luabind::def("create_ground_object_from_model", &lua_create_ground_object_from_model), + luabind::def("create_door", &lua_create_door), + luabind::def("modify_npc_stat", &lua_modify_npc_stat), + luabind::def("count_items", &lua_count_items), + luabind::def("update_spawn_timer", &lua_update_spawn_timer), + luabind::def("merchant_set_item", &lua_merchant_set_item), + luabind::def("merchant_count_item", &lua_merchant_count_item), + luabind::def("item_link", &lua_item_link), + luabind::def("say_link", &lua_say_link), + luabind::def("get_guild_name_by_id", &lua_get_guild_name_by_id), + luabind::def("create_instance", &lua_create_instance), + luabind::def("destroy_instance", &lua_destroy_instance), + luabind::def("get_instance_id", &lua_get_instance_id), + luabind::def("assign_to_instance", &lua_assign_to_instance), + luabind::def("assign_group_to_instance", &lua_assign_group_to_instance), + luabind::def("assign_raid_to_instance", &lua_assign_raid_to_instance), + luabind::def("flag_instance_by_group_leader", &lua_flag_instance_by_group_leader), + luabind::def("flag_instance_by_raid_leader", &lua_flag_instance_by_raid_leader), + luabind::def("fly_mode", &lua_fly_mode), + luabind::def("faction_value", &lua_faction_value), + luabind::def("check_title", &lua_check_title), + luabind::def("enable_title", &lua_enable_title), + luabind::def("remove_title", &lua_remove_title), + luabind::def("wear_change", &lua_wear_change), + luabind::def("voice_tell", &lua_voice_tell), + luabind::def("send_mail", &lua_send_mail), + luabind::def("cross_zone_signal_client_by_char_id", &lua_cross_zone_signal_client_by_char_id), + luabind::def("cross_zone_signal_client_by_name", &lua_cross_zone_signal_client_by_name), + luabind::def("cross_zone_message_player_by_name", &lua_cross_zone_message_player_by_name) ]; } @@ -300,4 +921,88 @@ luabind::scope lua_register_events() { ]; } +luabind::scope lua_register_faction() { + return luabind::class_("Faction") + .enum_("constants") + [ + luabind::value("Ally", static_cast(FACTION_ALLY)), + luabind::value("Warmly", static_cast(FACTION_WARMLY)), + luabind::value("Kindly", static_cast(FACTION_KINDLY)), + luabind::value("Amiable", static_cast(FACTION_AMIABLE)), + luabind::value("Indifferent", static_cast(FACTION_INDIFFERENT)), + luabind::value("Apprehensive", static_cast(FACTION_APPREHENSIVE)), + luabind::value("Dubious", static_cast(FACTION_DUBIOUS)), + luabind::value("Threatenly", static_cast(FACTION_THREATENLY)), + luabind::value("Scowls", static_cast(FACTION_SCOWLS)) + ]; +} + +luabind::scope lua_register_slot() { + return luabind::class_("Slot") + .enum_("constants") + [ + luabind::value("Charm", static_cast(SLOT_CHARM)), + luabind::value("Ear1", static_cast(SLOT_EAR01)), + luabind::value("Head", static_cast(SLOT_HEAD)), + luabind::value("Face", static_cast(SLOT_FACE)), + luabind::value("Ear2", static_cast(SLOT_EAR02)), + luabind::value("Neck", static_cast(SLOT_NECK)), + luabind::value("Shoulder", static_cast(SLOT_SHOULDER)), + luabind::value("Arms", static_cast(SLOT_ARMS)), + luabind::value("Back", static_cast(SLOT_BACK)), + luabind::value("Bracer1", static_cast(SLOT_BRACER01)), + luabind::value("Bracer2", static_cast(SLOT_BRACER02)), + luabind::value("Range", static_cast(SLOT_RANGE)), + luabind::value("Hands", static_cast(SLOT_HANDS)), + luabind::value("Primary", static_cast(SLOT_PRIMARY)), + luabind::value("Secondary", static_cast(SLOT_SECONDARY)), + luabind::value("Ring1", static_cast(SLOT_RING01)), + luabind::value("Ring2", static_cast(SLOT_RING02)), + luabind::value("Chest", static_cast(SLOT_CHEST)), + luabind::value("Legs", static_cast(SLOT_LEGS)), + luabind::value("Feet", static_cast(SLOT_FEET)), + luabind::value("Waist", static_cast(SLOT_WAIST)), + luabind::value("Ammo", static_cast(SLOT_AMMO)), + luabind::value("PersonalBegin", static_cast(SLOT_PERSONAL_BEGIN)), + luabind::value("PersonalEnd", static_cast(SLOT_PERSONAL_END)), + luabind::value("Cursor", static_cast(SLOT_CURSOR)), + luabind::value("CursorEnd", 0xFFFE), + luabind::value("Tradeskill", static_cast(SLOT_TRADESKILL)), + luabind::value("Augment", static_cast(SLOT_AUGMENT)), + luabind::value("PowerSource", static_cast(SLOT_POWER_SOURCE)), + luabind::value("Invalid", 0xFFFF) + ]; +} + +luabind::scope lua_register_material() { + return luabind::class_("Material") + .enum_("constants") + [ + luabind::value("Head", MATERIAL_HEAD), + luabind::value("Chest", MATERIAL_CHEST), + luabind::value("Arms", MATERIAL_ARMS), + luabind::value("Bracer", MATERIAL_BRACER), + luabind::value("Hands", MATERIAL_HANDS), + luabind::value("Legs", MATERIAL_LEGS), + luabind::value("Feet", MATERIAL_FEET), + luabind::value("Primary", MATERIAL_PRIMARY), + luabind::value("Secondary", MATERIAL_SECONDARY), + luabind::value("Max", MAX_MATERIALS) + ]; +} + +luabind::scope lua_register_client_version() { + return luabind::class_("ClientVersion") + .enum_("constants") + [ + luabind::value("Unknown", static_cast(EQClientUnknown)), + luabind::value("62", static_cast(EQClient62)), + luabind::value("Titanium", static_cast(EQClientTitanium)), + luabind::value("SoF", static_cast(EQClientSoF)), + luabind::value("SoD", static_cast(EQClientSoD)), + luabind::value("Underfoot", static_cast(EQClientUnderfoot)), + luabind::value("RoF", static_cast(EQClientRoF)) + ]; +} + #endif diff --git a/zone/lua_hate_entry.cpp b/zone/lua_hate_entry.cpp index 940701d42..9c723d67b 100644 --- a/zone/lua_hate_entry.cpp +++ b/zone/lua_hate_entry.cpp @@ -1,9 +1,15 @@ #ifdef LUA_EQEMU +#include "lua.hpp" +#include +#include +#include + #include "masterentity.h" #include "hate_list.h" #include "lua_mob.h" #include "lua_hate_entry.h" +#include "lua_hate_list.h" Lua_Mob Lua_HateEntry::GetEnt() { Lua_Safe_Call_Mob(); @@ -45,4 +51,20 @@ void Lua_HateEntry::SetFrenzy(bool value) { self->bFrenzy = value; } +luabind::scope lua_register_hate_entry() { + + return luabind::class_("HateEntry") + .property("null", &Lua_HateEntry::Null) + .property("valid", &Lua_HateEntry::Valid) + .property("ent", &Lua_HateEntry::GetEnt, &Lua_HateEntry::SetEnt) + .property("damage", &Lua_HateEntry::GetDamage, &Lua_HateEntry::SetDamage) + .property("hate", &Lua_HateEntry::GetHate, &Lua_HateEntry::SetHate) + .property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy); +} + +luabind::scope lua_register_hate_list() { + return luabind::class_("HateList") + .def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator); +} + #endif diff --git a/zone/lua_hate_entry.h b/zone/lua_hate_entry.h index c79cca7ea..78cafea85 100644 --- a/zone/lua_hate_entry.h +++ b/zone/lua_hate_entry.h @@ -7,6 +7,9 @@ class Lua_Mob; struct tHateEntry; +luabind::scope lua_register_hate_entry(); +luabind::scope lua_register_hate_list(); + class Lua_HateEntry : public Lua_Ptr { typedef tHateEntry NativeType; diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 100660a6a..ec4303093 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -3,7 +3,6 @@ #include "lua.hpp" #include #include -#include #include #include @@ -674,6 +673,10 @@ std::string LuaParser::GetVar(std::string name) { return std::string(); } +void LuaParser::Init() { + ReloadQuests(); +} + void LuaParser::ReloadQuests() { loaded_.clear(); errors_.clear(); @@ -795,6 +798,10 @@ void LuaParser::MapFunctions(lua_State *L) { [ lua_register_general(), lua_register_events(), + lua_register_faction(), + lua_register_slot(), + lua_register_material(), + lua_register_client_version(), lua_register_entity(), lua_register_mob(), lua_register_npc(), @@ -803,17 +810,8 @@ void LuaParser::MapFunctions(lua_State *L) { lua_register_iteminst(), lua_register_item(), lua_register_spell(), - - luabind::class_("HateEntry") - .property("null", &Lua_HateEntry::Null) - .property("valid", &Lua_HateEntry::Valid) - .property("ent", &Lua_HateEntry::GetEnt, &Lua_HateEntry::SetEnt) - .property("damage", &Lua_HateEntry::GetDamage, &Lua_HateEntry::SetDamage) - .property("hate", &Lua_HateEntry::GetHate, &Lua_HateEntry::SetHate) - .property("frenzy", &Lua_HateEntry::GetFrenzy, &Lua_HateEntry::SetFrenzy), - - luabind::class_("HateList") - .def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator) + lua_register_hate_entry(), + lua_register_hate_list() ]; } catch(std::exception &ex) { diff --git a/zone/lua_parser.h b/zone/lua_parser.h index d19e7e350..98418c7f8 100644 --- a/zone/lua_parser.h +++ b/zone/lua_parser.h @@ -51,6 +51,7 @@ public: virtual void AddVar(std::string name, std::string val); virtual std::string GetVar(std::string name); + virtual void Init(); virtual void ReloadQuests(); virtual uint32 GetIdentifier() { return 0xb0712acc; } diff --git a/zone/lua_parser_events.cpp b/zone/lua_parser_events.cpp index 639b07297..94be01291 100644 --- a/zone/lua_parser_events.cpp +++ b/zone/lua_parser_events.cpp @@ -9,6 +9,7 @@ #include "masterentity.h" #include "../common/seperator.h" +#include "../common/MiscFunctions.h" #include "lua_item.h" #include "lua_iteminst.h" #include "lua_entity.h" @@ -44,103 +45,28 @@ void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob * lua_createtable(L, 0, 0); std::stringstream ident; ident << npc->GetNPCTypeID(); + + for(int i = 1; i <= 4; ++i) { + std::string prefix = "item" + std::to_string(i); + + std::string cur = prefix; + lua_pushinteger(L, std::stoul(parse->GetVar(prefix + "." + ident.str()))); + lua_setfield(L, -2, prefix.c_str()); + + lua_pushinteger(L, std::stoul(parse->GetVar(prefix + ".charges." + ident.str()))); + lua_setfield(L, -2, std::string(prefix + "_charges").c_str()); + + lua_pushboolean(L, std::stoul(parse->GetVar(prefix + ".attuned." + ident.str()))); + lua_setfield(L, -2, std::string(prefix + "_attuned").c_str()); + + for(int j = 1; j <= 5; ++j) { + std::string augment = "augment" + std::to_string(j); + + lua_pushinteger(L, std::stoul(parse->GetVar(prefix + "." + augment + "." + ident.str()))); + lua_setfield(L, -2, std::string(prefix + "_" + augment).c_str()); + } + } - lua_pushinteger(L, std::stoul(parse->GetVar("item1." + ident.str()))); - lua_setfield(L, -2, "item1"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2." + ident.str()))); - lua_setfield(L, -2, "item2"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3." + ident.str()))); - lua_setfield(L, -2, "item3"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4." + ident.str()))); - lua_setfield(L, -2, "item4"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.charges." + ident.str()))); - lua_setfield(L, -2, "item1_charges"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.charges." + ident.str()))); - lua_setfield(L, -2, "item2_charges"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.charges." + ident.str()))); - lua_setfield(L, -2, "item3_charges"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.charges." + ident.str()))); - lua_setfield(L, -2, "item4_charges"); - - lua_pushboolean(L, std::stoul(parse->GetVar("item1.attuned." + ident.str())) != 0 ? true : false); - lua_setfield(L, -2, "item1_attuned"); - - lua_pushboolean(L, std::stoul(parse->GetVar("item2.attuned." + ident.str())) != 0 ? true : false); - lua_setfield(L, -2, "item2_attuned"); - - lua_pushboolean(L, std::stoul(parse->GetVar("item3.attuned." + ident.str())) != 0 ? true : false); - lua_setfield(L, -2, "item3_attuned"); - - lua_pushboolean(L, std::stoul(parse->GetVar("item4.attuned." + ident.str())) != 0 ? true : false); - lua_setfield(L, -2, "item4_attuned"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.augment1." + ident.str()))); - lua_setfield(L, -2, "item1_augment1"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.augment2." + ident.str()))); - lua_setfield(L, -2, "item1_augment2"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.augment3." + ident.str()))); - lua_setfield(L, -2, "item1_augment3"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.augment4." + ident.str()))); - lua_setfield(L, -2, "item1_augment4"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item1.augment5." + ident.str()))); - lua_setfield(L, -2, "item1_augment5"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.augment1." + ident.str()))); - lua_setfield(L, -2, "item2_augment1"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.augment2." + ident.str()))); - lua_setfield(L, -2, "item2_augment2"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.augment3." + ident.str()))); - lua_setfield(L, -2, "item2_augment3"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.augment4." + ident.str()))); - lua_setfield(L, -2, "item2_augment4"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item2.augment5." + ident.str()))); - lua_setfield(L, -2, "item2_augment5"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.augment1." + ident.str()))); - lua_setfield(L, -2, "item3_augment1"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.augment2." + ident.str()))); - lua_setfield(L, -2, "item3_augment2"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.augment3." + ident.str()))); - lua_setfield(L, -2, "item3_augment3"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.augment4." + ident.str()))); - lua_setfield(L, -2, "item3_augment4"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item3.augment5." + ident.str()))); - lua_setfield(L, -2, "item3_augment5"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.augment1." + ident.str()))); - lua_setfield(L, -2, "item4_augment1"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.augment2." + ident.str()))); - lua_setfield(L, -2, "item4_augment2"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.augment3." + ident.str()))); - lua_setfield(L, -2, "item4_augment3"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.augment4." + ident.str()))); - lua_setfield(L, -2, "item4_augment4"); - - lua_pushinteger(L, std::stoul(parse->GetVar("item4.augment5." + ident.str()))); - lua_setfield(L, -2, "item4_augment5"); - lua_pushinteger(L, std::stoul(parse->GetVar("platinum." + ident.str()))); lua_setfield(L, -2, "platinum"); diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 0b7a9703b..da3572830 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2451,9 +2451,7 @@ const char* QuestManager::varlink(char* perltext, int item_id) { char* link = 0; char* tempstr = 0; if (initiator->MakeItemLink(link, inst)) { // make a link to the item - MakeAnyLenString(&tempstr, "%c%s%s%c", 0x12, link, inst->GetItem()->Name, 0x12); - strn0cpy(perltext, tempstr, 250); // the perl string is only 250 chars, so make sure the link isn't too large - safe_delete_array(tempstr); // MakeAnyLenString() uses new, so clean up after it + snprintf(perltext, 250, "%c%s%s%c", 0x12, link, inst->GetItem()->Name, 0x12); } safe_delete_array(link); // MakeItemLink() uses new also safe_delete(inst); diff --git a/zone/zone.cpp b/zone/zone.cpp index dadb277c6..ca075de7c 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -168,7 +168,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { LogFile->write(EQEMuLog::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); LogFile->write(EQEMuLog::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); - parse->ReloadQuests(true); + parse->Init(); UpdateWindowTitle(); zone->GetTimeSync();