mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
Cleanup of some lua code, initial work on encounter_quests
This commit is contained in:
parent
17954dd8fe
commit
69bad31019
@ -341,9 +341,6 @@ public:
|
||||
int16 GetCurrentSlot() const { return m_currentslot; }
|
||||
void SetCurrentSlot(int16 curr_slot) { m_currentslot = curr_slot; }
|
||||
|
||||
|
||||
|
||||
|
||||
// Is this item already attuned?
|
||||
bool IsInstNoDrop() const { return m_instnodrop; }
|
||||
void SetInstNoDrop(bool flag) { m_instnodrop=flag; }
|
||||
|
||||
@ -429,7 +429,6 @@ RULE_BOOL ( Chat, ServerWideAuction, true)
|
||||
RULE_BOOL ( Chat, EnableVoiceMacros, true)
|
||||
RULE_BOOL ( Chat, EnableMailKeyIPVerification, true)
|
||||
RULE_BOOL ( Chat, EnableAntiSpam, true)
|
||||
RULE_BOOL ( Chat, FlowCommandstoPerl_EVENT_SAY, false) // Allows you to parse #commands into EVENT_SAY (Useful in global_player.pl) that aren't found in the source - should probably be individual scripts per command sometime
|
||||
RULE_INT ( Chat, MinStatusToBypassAntiSpam, 100)
|
||||
RULE_INT ( Chat, MinimumMessagesPerInterval, 4)
|
||||
RULE_INT ( Chat, MaximumMessagesPerInterval, 12)
|
||||
|
||||
@ -33,6 +33,7 @@ SET(zone_sources
|
||||
loottables.cpp
|
||||
lua_client.cpp
|
||||
lua_entity.cpp
|
||||
lua_general.cpp
|
||||
lua_hate_entry.cpp
|
||||
lua_item.cpp
|
||||
lua_iteminst.cpp
|
||||
@ -134,6 +135,7 @@ SET(zone_headers
|
||||
horse.h
|
||||
lua_client.h
|
||||
lua_entity.h
|
||||
lua_general.h
|
||||
lua_item.h
|
||||
lua_iteminst.h
|
||||
lua_mob.h
|
||||
|
||||
@ -34,7 +34,8 @@ public:
|
||||
virtual int EventGlobalPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) { return 0; }
|
||||
virtual int EventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) { return 0; }
|
||||
virtual int EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) { return 0; }
|
||||
|
||||
virtual int EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data) { return 0; }
|
||||
|
||||
virtual bool HasQuestSub(uint32 npcid, const char *subname) { return false; }
|
||||
virtual bool HasGlobalQuestSub(const char *subname) { return false; }
|
||||
virtual bool PlayerHasQuestSub(const char *subname) { return false; }
|
||||
@ -48,11 +49,19 @@ public:
|
||||
virtual void LoadGlobalPlayerScript(std::string filename) { }
|
||||
virtual void LoadItemScript(std::string filename, std::string item_script) { }
|
||||
virtual void LoadSpellScript(std::string filename, uint32 spell_id) { }
|
||||
virtual void LoadEncounterScript(std::string filename, std::string encounter_name) { }
|
||||
|
||||
virtual void DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) { }
|
||||
virtual void DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) { }
|
||||
virtual void DispatchEventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) { }
|
||||
virtual void DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) { }
|
||||
|
||||
virtual void AddVar(std::string name, std::string val) { }
|
||||
virtual std::string GetVar(std::string name) { return std::string(); }
|
||||
virtual void ReloadQuests() { }
|
||||
virtual uint32 GetIdentifier() = 0;
|
||||
|
||||
virtual void GetErrors(std::list<std::string> &err) { }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -64,6 +64,7 @@ void QuestParserCollection::ReloadQuests(bool reset_timers) {
|
||||
_global_npc_quest_status = QuestUnloaded;
|
||||
_spell_quest_status.clear();
|
||||
_item_quest_status.clear();
|
||||
_encounter_quest_status.clear();
|
||||
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->ReloadQuests();
|
||||
@ -218,7 +219,8 @@ bool QuestParserCollection::ItemHasQuestSub(ItemInst *itm, const char *subname)
|
||||
int QuestParserCollection::EventNPC(QuestEventID evt, NPC *npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
int rl = EventNPCLocal(evt, npc, init, data, extra_data);
|
||||
int rg = EventNPCGlobal(evt, npc, init, data, extra_data);
|
||||
|
||||
DispatchEventNPC(evt, npc, init, data, extra_data);
|
||||
|
||||
//Local quests returning non-default values have priority over global quests
|
||||
if(rl != 0) {
|
||||
return rl;
|
||||
@ -272,6 +274,7 @@ int QuestParserCollection::EventNPCGlobal(QuestEventID evt, NPC* npc, Mob *init,
|
||||
int QuestParserCollection::EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
int rl = EventPlayerLocal(evt, client, data, extra_data);
|
||||
int rg = EventPlayerGlobal(evt, client, data, extra_data);
|
||||
DispatchEventPlayer(evt, client, data, extra_data);
|
||||
|
||||
//Local quests returning non-default values have priority over global quests
|
||||
if(rl != 0) {
|
||||
@ -335,17 +338,23 @@ int QuestParserCollection::EventItem(QuestEventID evt, Client *client, ItemInst
|
||||
//loaded or failed to load
|
||||
if(iter->second != QuestFailedToLoad) {
|
||||
std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
|
||||
return qiter->second->EventItem(evt, client, item, objid, extra_data);
|
||||
auto ret = qiter->second->EventItem(evt, client, item, objid, extra_data);
|
||||
DispatchEventItem(evt, client, item, objid, extra_data);
|
||||
return ret;
|
||||
}
|
||||
DispatchEventItem(evt, client, item, objid, extra_data);
|
||||
} else {
|
||||
std::string filename;
|
||||
QuestInterface *qi = GetQIByItemQuest(item_script, filename);
|
||||
if(qi) {
|
||||
_item_quest_status[item_script] = qi->GetIdentifier();
|
||||
qi->LoadItemScript(filename, item_script);
|
||||
return qi->EventItem(evt, client, item, objid, extra_data);
|
||||
auto ret = qi->EventItem(evt, client, item, objid, extra_data);
|
||||
DispatchEventItem(evt, client, item, objid, extra_data);
|
||||
return ret;
|
||||
} else {
|
||||
_item_quest_status[item_script] = QuestFailedToLoad;
|
||||
DispatchEventItem(evt, client, item, objid, extra_data);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -357,17 +366,45 @@ int QuestParserCollection::EventSpell(QuestEventID evt, NPC* npc, Client *client
|
||||
//loaded or failed to load
|
||||
if(iter->second != QuestFailedToLoad) {
|
||||
std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
|
||||
return qiter->second->EventSpell(evt, npc, client, spell_id, extra_data);
|
||||
auto ret = qiter->second->EventSpell(evt, npc, client, spell_id, extra_data);
|
||||
DispatchEventSpell(evt, npc, client, spell_id, extra_data);
|
||||
return ret;
|
||||
}
|
||||
DispatchEventSpell(evt, npc, client, spell_id, extra_data);
|
||||
} else {
|
||||
std::string filename;
|
||||
QuestInterface *qi = GetQIBySpellQuest(spell_id, filename);
|
||||
if(qi) {
|
||||
_spell_quest_status[spell_id] = qi->GetIdentifier();
|
||||
qi->LoadSpellScript(filename, spell_id);
|
||||
return qi->EventSpell(evt, npc, client, spell_id, extra_data);
|
||||
auto ret = qi->EventSpell(evt, npc, client, spell_id, extra_data);
|
||||
DispatchEventSpell(evt, npc, client, spell_id, extra_data);
|
||||
return ret;
|
||||
} else {
|
||||
_spell_quest_status[spell_id] = QuestFailedToLoad;
|
||||
DispatchEventSpell(evt, npc, client, spell_id, extra_data);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int QuestParserCollection::EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data) {
|
||||
auto iter = _encounter_quest_status.find(encounter_name);
|
||||
if(iter != _encounter_quest_status.end()) {
|
||||
//loaded or failed to load
|
||||
if(iter->second != QuestFailedToLoad) {
|
||||
std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
|
||||
return qiter->second->EventEncounter(evt, encounter_name, extra_data);
|
||||
}
|
||||
} else {
|
||||
std::string filename;
|
||||
QuestInterface *qi = GetQIByEncounterQuest(encounter_name, filename);
|
||||
if(qi) {
|
||||
_encounter_quest_status[encounter_name] = qi->GetIdentifier();
|
||||
qi->LoadEncounterScript(filename, encounter_name);
|
||||
return qi->EventEncounter(evt, encounter_name, extra_data);
|
||||
} else {
|
||||
_encounter_quest_status[encounter_name] = QuestFailedToLoad;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -746,3 +783,93 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script,
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QuestInterface *QuestParserCollection::GetQIByEncounterQuest(std::string encounter_name, std::string &filename) {
|
||||
//first look for /quests/zone/encounters/encounter_name.ext (precedence)
|
||||
filename = "quests/";
|
||||
filename += zone->GetShortName();
|
||||
filename += "/encounters/";
|
||||
filename += encounter_name;
|
||||
std::string tmp;
|
||||
FILE *f = nullptr;
|
||||
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
tmp = filename;
|
||||
auto ext = _extensions.find((*iter)->GetIdentifier());
|
||||
tmp += ".";
|
||||
tmp += ext->second;
|
||||
f = fopen(tmp.c_str(), "r");
|
||||
if(f) {
|
||||
fclose(f);
|
||||
filename = tmp;
|
||||
return (*iter);
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
//second look for /quests/encounters/encounter_name.ext (precedence)
|
||||
filename = "quests/encounters/";
|
||||
filename += encounter_name;
|
||||
|
||||
iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
tmp = filename;
|
||||
auto ext = _extensions.find((*iter)->GetIdentifier());
|
||||
tmp += ".";
|
||||
tmp += ext->second;
|
||||
f = fopen(tmp.c_str(), "r");
|
||||
if(f) {
|
||||
fclose(f);
|
||||
filename = tmp;
|
||||
return (*iter);
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void QuestParserCollection::GetErrors(std::list<std::string> &err) {
|
||||
err.clear();
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->GetErrors(err);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void QuestParserCollection::DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->DispatchEventNPC(evt, npc, init, data, extra_data);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void QuestParserCollection::DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->DispatchEventPlayer(evt, client, data, extra_data);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void QuestParserCollection::DispatchEventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) {
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->DispatchEventItem(evt, client, item, objid, extra_data);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void QuestParserCollection::DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) {
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
(*iter)->DispatchEventSpell(evt, npc, client, spell_id, extra_data);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +52,9 @@ public:
|
||||
int EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data);
|
||||
int EventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data);
|
||||
int EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data);
|
||||
int EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data);
|
||||
|
||||
void GetErrors(std::list<std::string> &err);
|
||||
|
||||
private:
|
||||
bool HasQuestSubLocal(uint32 npcid, const char *subname);
|
||||
@ -70,6 +73,12 @@ private:
|
||||
QuestInterface *GetQIByGlobalPlayerQuest(std::string &filename);
|
||||
QuestInterface *GetQIBySpellQuest(uint32 spell_id, std::string &filename);
|
||||
QuestInterface *GetQIByItemQuest(std::string item_script, std::string &filename);
|
||||
QuestInterface *GetQIByEncounterQuest(std::string encounter_name, std::string &filename);
|
||||
|
||||
void DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data);
|
||||
void DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data);
|
||||
void DispatchEventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data);
|
||||
void DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data);
|
||||
|
||||
std::map<uint32, QuestInterface*> _interfaces;
|
||||
std::map<uint32, std::string> _extensions;
|
||||
@ -83,6 +92,7 @@ private:
|
||||
uint32 _global_player_quest_status;
|
||||
std::map<uint32, uint32> _spell_quest_status;
|
||||
std::map<std::string, uint32> _item_quest_status;
|
||||
std::map<std::string, uint32> _encounter_quest_status;
|
||||
};
|
||||
|
||||
extern QuestParserCollection *parse;
|
||||
|
||||
@ -1037,13 +1037,14 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
case 8: { // /say
|
||||
if(message[0] == COMMAND_CHAR) {
|
||||
if(command_dispatch(this, message) == -2) {
|
||||
if(RuleB(Chat, FlowCommandstoPerl_EVENT_SAY)) {
|
||||
if(parse->PlayerHasQuestSub("EVENT_SAY")) {
|
||||
parse->EventPlayer(EVENT_SAY, this, message, language);
|
||||
}
|
||||
} else {
|
||||
//LUA_TODO: fix this with something like event_command
|
||||
//if(RuleB(Chat, FlowCommandstoPerl_EVENT_SAY)) {
|
||||
// if(parse->PlayerHasQuestSub("EVENT_SAY")) {
|
||||
// parse->EventPlayer(EVENT_SAY, this, message, language);
|
||||
// }
|
||||
//} else {
|
||||
this->Message(13, "Command '%s' not recognized.", message);
|
||||
}
|
||||
//}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1051,12 +1052,8 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
if (GetPet() && GetPet()->FindType(SE_VoiceGraft))
|
||||
sender = GetPet();
|
||||
|
||||
printf("Message: %s\n",message);
|
||||
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
|
||||
if(parse->PlayerHasQuestSub("EVENT_SAY"))
|
||||
{
|
||||
parse->EventPlayer(EVENT_SAY, this, message, language);
|
||||
}
|
||||
parse->EventPlayer(EVENT_SAY, this, message, language);
|
||||
|
||||
if (sender != this)
|
||||
break;
|
||||
@ -1069,36 +1066,21 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
CheckLDoNHail(GetTarget());
|
||||
CheckEmoteHail(GetTarget(), message);
|
||||
|
||||
if(parse->HasQuestSub(GetTarget()->GetNPCTypeID(), "EVENT_SAY")){
|
||||
if (DistNoRootNoZ(*GetTarget()) <= 200) {
|
||||
if(GetTarget()->CastToNPC()->IsMoving() && !GetTarget()->CastToNPC()->IsOnHatelist(GetTarget()))
|
||||
GetTarget()->CastToNPC()->PauseWandering(RuleI(NPC, SayPauseTimeInSec));
|
||||
|
||||
Mob *targ = GetTarget();
|
||||
if(targ->GetAppearance() != eaDead)
|
||||
targ->FaceTarget(this);
|
||||
parse->EventNPC(EVENT_SAY, targ->CastToNPC(), this, message, language);
|
||||
}
|
||||
}
|
||||
if(DistNoRootNoZ(*GetTarget()) <= 200) {
|
||||
NPC *tar = GetTarget()->CastToNPC();
|
||||
parse->EventNPC(EVENT_SAY, tar->CastToNPC(), this, message, language);
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && DistNoRootNoZ(*GetTarget()) <= 200) {
|
||||
|
||||
if(GetTarget()->CastToNPC()->IsMoving() && !GetTarget()->CastToNPC()->IsOnHatelist(GetTarget()))
|
||||
GetTarget()->CastToNPC()->PauseWandering(RuleI(NPC, SayPauseTimeInSec));
|
||||
|
||||
if(UpdateTasksOnSpeakWith(GetTarget()->GetNPCTypeID())) {
|
||||
// If the client had an activity to talk to this NPC, make the NPC turn to face him if
|
||||
// he isn't moving. Makes things look better.
|
||||
if(!GetTarget()->CastToNPC()->IsMoving())
|
||||
GetTarget()->FaceTarget(this);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
if(UpdateTasksOnSpeakWith(tar->GetNPCTypeID())) {
|
||||
tar->DoQuestPause(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(parse->HasQuestSub(GetTarget()->GetNPCTypeID(), "EVENT_AGGRO_SAY")) {
|
||||
if (DistNoRootNoZ(*GetTarget()) <= 200) {
|
||||
parse->EventNPC(EVENT_AGGRO_SAY, GetTarget()->CastToNPC(), this, message, language);
|
||||
}
|
||||
if (DistNoRootNoZ(*GetTarget()) <= 200) {
|
||||
parse->EventNPC(EVENT_AGGRO_SAY, GetTarget()->CastToNPC(), this, message, language);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3260,13 +3260,10 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
|
||||
{
|
||||
if( !mod_saylink(response, silentsaylink) ) { return; }
|
||||
|
||||
if(this->GetTarget() && this->GetTarget()->IsNPC())
|
||||
if(GetTarget() && GetTarget()->IsNPC())
|
||||
{
|
||||
if(silentsaylink)
|
||||
{
|
||||
Mob *targ = GetTarget();
|
||||
if(targ->GetAppearance() != eaDead)
|
||||
targ->FaceTarget(this);
|
||||
parse->EventNPC(EVENT_SAY, GetTarget()->CastToNPC(), this, response.c_str(), 0);
|
||||
parse->EventPlayer(EVENT_SAY, this, response.c_str(), 0);
|
||||
}
|
||||
|
||||
@ -265,8 +265,7 @@ int command_init(void) {
|
||||
command_add("viewnpctype","[npctype id] - Show info about an npctype",100,command_viewnpctype) ||
|
||||
command_add("reloadstatic","- Reload Static Zone Data",150,command_reloadstatic) ||
|
||||
command_add("reloadquest"," - Clear quest cache (any argument causes it to also stop all timers)",150,command_reloadqst) ||
|
||||
command_add("reloadqst",nullptr,0,command_reloadqst) ||
|
||||
command_add("reloadpl",nullptr,0,command_reloadqst) ||
|
||||
command_add("reloadqst"," - Clear quest cache (any argument causes it to also stop all timers)",150,command_reloadqst) ||
|
||||
command_add("reloadworld",nullptr,255,command_reloadworld) ||
|
||||
command_add("reloadlevelmods",nullptr,255,command_reloadlevelmods) ||
|
||||
command_add("rq",nullptr,0,command_reloadqst) ||
|
||||
@ -445,7 +444,8 @@ int command_init(void) {
|
||||
command_add("mysql", "Mysql CLI, see 'help' for options.", 250, command_mysql) ||
|
||||
command_add("xtargets", "Show your targets Extended Targets and optionally set how many xtargets they can have.", 250, command_xtargets) ||
|
||||
command_add("zopp", "Troubleshooting command - Sends a fake item packet to you. No server reference is created.", 250, command_zopp) ||
|
||||
command_add("augmentitem", "Force augments an item. Must have the augment item window open.", 250, command_augmentitem)
|
||||
command_add("augmentitem", "Force augments an item. Must have the augment item window open.", 250, command_augmentitem) ||
|
||||
command_add("questerrors", "Shows quest errors.", 100, command_questerrors)
|
||||
)
|
||||
{
|
||||
command_deinit();
|
||||
@ -11440,3 +11440,22 @@ void command_augmentitem(Client *c, const Seperator *sep)
|
||||
safe_delete_array(in_augment);
|
||||
}
|
||||
|
||||
void command_questerrors(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::list<std::string> err;
|
||||
parse->GetErrors(err);
|
||||
c->Message(0, "Current Quest Errors:");
|
||||
|
||||
auto iter = err.begin();
|
||||
int i = 0;
|
||||
while(iter != err.end()) {
|
||||
if(i >= 30) {
|
||||
c->Message(0, "Maximum of 30 Errors shown...");
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(0, iter->c_str());
|
||||
++i;
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
@ -319,12 +319,7 @@ void command_mysql(Client *c, const Seperator *sep);
|
||||
void command_xtargets(Client *c, const Seperator *sep);
|
||||
void command_zopp(Client *c, const Seperator *sep);
|
||||
void command_augmentitem(Client *c, const Seperator *sep);
|
||||
|
||||
#ifdef EMBPERL
|
||||
void command_embperl_plugin(Client *c, const Seperator *sep);
|
||||
void command_embperl_eval(Client *c, const Seperator *sep);
|
||||
void command_reloadpl(Client *c, const Seperator *sep);
|
||||
#endif
|
||||
void command_questerrors(Client *c, const Seperator *sep);
|
||||
|
||||
#ifdef EQPROFILE
|
||||
void command_profiledump(Client *c, const Seperator *sep);
|
||||
|
||||
@ -91,7 +91,9 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_CONNECT",
|
||||
"EVENT_ITEM_TICK",
|
||||
"EVENT_DUEL_WIN",
|
||||
"EVENT_DUEL_LOSE"
|
||||
"EVENT_DUEL_LOSE",
|
||||
"EVENT_ENCOUNTER_LOAD",
|
||||
"EVENT_ENCOUNTER_UNLOAD"
|
||||
};
|
||||
|
||||
PerlembParser::PerlembParser() : perl(nullptr), event_queue_in_use_(false) {
|
||||
@ -1064,6 +1066,10 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID
|
||||
{
|
||||
switch (event) {
|
||||
case EVENT_SAY: {
|
||||
if(npc && mob) {
|
||||
npc->DoQuestPause(mob);
|
||||
}
|
||||
|
||||
ExportVar(package_name.c_str(), "data", objid);
|
||||
ExportVar(package_name.c_str(), "text", data);
|
||||
ExportVar(package_name.c_str(), "langid", extradata);
|
||||
|
||||
@ -61,6 +61,8 @@ typedef enum {
|
||||
EVENT_ITEM_TICK,
|
||||
EVENT_DUEL_WIN,
|
||||
EVENT_DUEL_LOSE,
|
||||
EVENT_ENCOUNTER_LOAD,
|
||||
EVENT_ENCOUNTER_UNLOAD,
|
||||
|
||||
_LargestEventID
|
||||
} QuestEventID;
|
||||
|
||||
@ -3,6 +3,12 @@
|
||||
#include "masterentity.h"
|
||||
#include "lua_client.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
luabind::scope lua_register_client() {
|
||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||
.def(luabind::constructor<>());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
|
||||
class Client;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client();
|
||||
|
||||
class Lua_Client : public Lua_Mob
|
||||
{
|
||||
typedef Client NativeType;
|
||||
|
||||
@ -6,6 +6,9 @@
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
bool Lua_Entity::IsClient() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsClient();
|
||||
@ -84,4 +87,26 @@ Lua_Mob Lua_Entity::CastToMob() {
|
||||
return Lua_Mob(m);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity() {
|
||||
return luabind::class_<Lua_Entity>("Entity")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Entity::Null)
|
||||
.property("valid", &Lua_Entity::Valid)
|
||||
.def("IsClient", &Lua_Entity::IsClient)
|
||||
.def("IsNPC", &Lua_Entity::IsNPC)
|
||||
.def("IsMob", &Lua_Entity::IsMob)
|
||||
.def("IsMerc", &Lua_Entity::IsMerc)
|
||||
.def("IsCorpse", &Lua_Entity::IsCorpse)
|
||||
.def("IsPlayerCorpse", &Lua_Entity::IsPlayerCorpse)
|
||||
.def("IsNPCCorpse", &Lua_Entity::IsNPCCorpse)
|
||||
.def("IsObject", &Lua_Entity::IsObject)
|
||||
.def("IsDoor", &Lua_Entity::IsDoor)
|
||||
.def("IsTrap", &Lua_Entity::IsTrap)
|
||||
.def("IsBeacon", &Lua_Entity::IsBeacon)
|
||||
.def("GetID", &Lua_Entity::GetID)
|
||||
.def("CastToClient", &Lua_Entity::CastToClient)
|
||||
.def("CastToNPC", &Lua_Entity::CastToNPC)
|
||||
.def("CastToMob", &Lua_Entity::CastToMob);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -9,12 +9,8 @@ class Lua_Client;
|
||||
class Lua_NPC;
|
||||
class Lua_Mob;
|
||||
struct Lua_HateList;
|
||||
//class Lua_Merc;
|
||||
//class Lua_Corpse;
|
||||
//class Lua_Object;
|
||||
//class Lua_Doors;
|
||||
//class Lua_Trap;
|
||||
//class Lua_Item;
|
||||
class Lua_Item;
|
||||
class Lua_ItemInst;
|
||||
|
||||
//TODO: Remove the error checking by a flag since this adds significant overhead to each c call
|
||||
#define Lua_Safe_Call_Void() if(!d_) { return; } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
@ -27,6 +23,14 @@ struct Lua_HateList;
|
||||
#define Lua_Safe_Call_NPC() if(!d_) { return Lua_NPC(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
#define Lua_Safe_Call_Client() if(!d_) { return Lua_Client(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
#define Lua_Safe_Call_HateList() if(!d_) { return Lua_HateList(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
#define Lua_Safe_Call_Item() if(!d_) { return Lua_Item(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
#define Lua_Safe_Call_ItemInst() if(!d_) { return Lua_ItemInst(); } NativeType *self = reinterpret_cast<NativeType*>(d_)
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_entity();
|
||||
|
||||
class Lua_Entity : public Lua_Ptr<void>
|
||||
{
|
||||
|
||||
130
zone/lua_general.cpp
Normal file
130
zone/lua_general.cpp
Normal file
@ -0,0 +1,130 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
#include <sstream>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "lua_parser.h"
|
||||
#include "QuestParserCollection.h"
|
||||
|
||||
struct Events { };
|
||||
|
||||
struct lua_registered_event {
|
||||
std::string encounter_name;
|
||||
luabind::object lua_reference;
|
||||
QuestEventID event_id;
|
||||
};
|
||||
|
||||
extern std::map<std::string, std::list<lua_registered_event>> lua_encounter_events_registered;
|
||||
|
||||
void load_encounter(std::string name) {
|
||||
parse->EventEncounter(EVENT_ENCOUNTER_LOAD, name, 0);
|
||||
}
|
||||
|
||||
void unload_encounter(std::string name) {
|
||||
parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, 0);
|
||||
}
|
||||
|
||||
void register_npc_event(std::string name, int evt, int npc_id, luabind::object func) {
|
||||
if(luabind::type(func) == LUA_TFUNCTION) {
|
||||
std::stringstream package_name;
|
||||
package_name << "npc_" << npc_id;
|
||||
|
||||
lua_registered_event e;
|
||||
e.encounter_name = name;
|
||||
e.lua_reference = func;
|
||||
e.event_id = static_cast<QuestEventID>(evt);
|
||||
|
||||
auto liter = lua_encounter_events_registered.find(package_name.str());
|
||||
if(liter == lua_encounter_events_registered.end()) {
|
||||
std::list<lua_registered_event> elist;
|
||||
elist.push_back(e);
|
||||
lua_encounter_events_registered[package_name.str()] = elist;
|
||||
} else {
|
||||
std::list<lua_registered_event> elist = liter->second;
|
||||
elist.push_back(e);
|
||||
lua_encounter_events_registered[package_name.str()] = elist;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
luabind::scope lua_register_general() {
|
||||
return luabind::namespace_("eq")
|
||||
[
|
||||
luabind::def("load_encounter", &load_encounter),
|
||||
luabind::def("unload_encounter", &unload_encounter),
|
||||
luabind::def("register_npc_event", ®ister_npc_event)
|
||||
];
|
||||
}
|
||||
|
||||
luabind::scope lua_register_events() {
|
||||
return luabind::class_<Events>("Event")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("say", static_cast<int>(EVENT_SAY)),
|
||||
luabind::value("trade", static_cast<int>(EVENT_TRADE)),
|
||||
luabind::value("death", static_cast<int>(EVENT_DEATH)),
|
||||
luabind::value("spawn", static_cast<int>(EVENT_SPAWN)),
|
||||
luabind::value("attack", static_cast<int>(EVENT_ATTACK)),
|
||||
luabind::value("combat", static_cast<int>(EVENT_COMBAT)),
|
||||
luabind::value("aggro", static_cast<int>(EVENT_AGGRO)),
|
||||
luabind::value("slay", static_cast<int>(EVENT_SLAY)),
|
||||
luabind::value("npc_slay", static_cast<int>(EVENT_NPC_SLAY)),
|
||||
luabind::value("waypoint_arrive", static_cast<int>(EVENT_WAYPOINT_ARRIVE)),
|
||||
luabind::value("waypoint_depart", static_cast<int>(EVENT_WAYPOINT_DEPART)),
|
||||
luabind::value("timer", static_cast<int>(EVENT_TIMER)),
|
||||
luabind::value("signal", static_cast<int>(EVENT_SIGNAL)),
|
||||
luabind::value("hp", static_cast<int>(EVENT_HP)),
|
||||
luabind::value("enter", static_cast<int>(EVENT_ENTER)),
|
||||
luabind::value("exit", static_cast<int>(EVENT_EXIT)),
|
||||
luabind::value("enter_zone", static_cast<int>(EVENT_ENTER_ZONE)),
|
||||
luabind::value("click_door", static_cast<int>(EVENT_CLICK_DOOR)),
|
||||
luabind::value("loot", static_cast<int>(EVENT_LOOT)),
|
||||
luabind::value("zone", static_cast<int>(EVENT_ZONE)),
|
||||
luabind::value("level_up", static_cast<int>(EVENT_LEVEL_UP)),
|
||||
luabind::value("killed_merit ", static_cast<int>(EVENT_KILLED_MERIT )),
|
||||
luabind::value("cast_on", static_cast<int>(EVENT_CAST_ON)),
|
||||
luabind::value("task_accepted", static_cast<int>(EVENT_TASK_ACCEPTED)),
|
||||
luabind::value("task_stage_complete", static_cast<int>(EVENT_TASK_STAGE_COMPLETE)),
|
||||
luabind::value("task_update", static_cast<int>(EVENT_TASK_UPDATE)),
|
||||
luabind::value("task_complete", static_cast<int>(EVENT_TASK_COMPLETE)),
|
||||
luabind::value("task_fail", static_cast<int>(EVENT_TASK_FAIL)),
|
||||
luabind::value("aggro_say", static_cast<int>(EVENT_AGGRO_SAY)),
|
||||
luabind::value("player_pickup", static_cast<int>(EVENT_PLAYER_PICKUP)),
|
||||
luabind::value("popup_response", static_cast<int>(EVENT_POPUP_RESPONSE)),
|
||||
luabind::value("proximity_say", static_cast<int>(EVENT_PROXIMITY_SAY)),
|
||||
luabind::value("cast", static_cast<int>(EVENT_CAST)),
|
||||
luabind::value("scale_calc", static_cast<int>(EVENT_SCALE_CALC)),
|
||||
luabind::value("item_enter_zone", static_cast<int>(EVENT_ITEM_ENTER_ZONE)),
|
||||
luabind::value("target_change", static_cast<int>(EVENT_TARGET_CHANGE)),
|
||||
luabind::value("hate_list", static_cast<int>(EVENT_HATE_LIST)),
|
||||
luabind::value("spell_effect_client", static_cast<int>(EVENT_SPELL_EFFECT_CLIENT)),
|
||||
luabind::value("spell_effect_npc", static_cast<int>(EVENT_SPELL_EFFECT_NPC)),
|
||||
luabind::value("spell_effect_buff_tic_client", static_cast<int>(EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT)),
|
||||
luabind::value("spell_effect_buff_tic_npc", static_cast<int>(EVENT_SPELL_EFFECT_BUFF_TIC_NPC)),
|
||||
luabind::value("spell_effect_translocate_complete", static_cast<int>(EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE)),
|
||||
luabind::value("combine_success ", static_cast<int>(EVENT_COMBINE_SUCCESS )),
|
||||
luabind::value("combine_failure ", static_cast<int>(EVENT_COMBINE_FAILURE )),
|
||||
luabind::value("item_click", static_cast<int>(EVENT_ITEM_CLICK)),
|
||||
luabind::value("item_click_cast", static_cast<int>(EVENT_ITEM_CLICK_CAST)),
|
||||
luabind::value("group_change", static_cast<int>(EVENT_GROUP_CHANGE)),
|
||||
luabind::value("forage_success", static_cast<int>(EVENT_FORAGE_SUCCESS)),
|
||||
luabind::value("forage_failure", static_cast<int>(EVENT_FORAGE_FAILURE)),
|
||||
luabind::value("fish_start", static_cast<int>(EVENT_FISH_START)),
|
||||
luabind::value("fish_success", static_cast<int>(EVENT_FISH_SUCCESS)),
|
||||
luabind::value("fish_failure", static_cast<int>(EVENT_FISH_FAILURE)),
|
||||
luabind::value("click_object", static_cast<int>(EVENT_CLICK_OBJECT)),
|
||||
luabind::value("discover_item", static_cast<int>(EVENT_DISCOVER_ITEM)),
|
||||
luabind::value("disconnect", static_cast<int>(EVENT_DISCONNECT)),
|
||||
luabind::value("connect", static_cast<int>(EVENT_CONNECT)),
|
||||
luabind::value("item_tick", static_cast<int>(EVENT_ITEM_TICK)),
|
||||
luabind::value("duel_win", static_cast<int>(EVENT_DUEL_WIN)),
|
||||
luabind::value("duel_lose", static_cast<int>(EVENT_DUEL_LOSE)),
|
||||
luabind::value("encounter_load", static_cast<int>(EVENT_ENCOUNTER_LOAD)),
|
||||
luabind::value("encounter_unload", static_cast<int>(EVENT_ENCOUNTER_UNLOAD))
|
||||
];
|
||||
}
|
||||
|
||||
#endif
|
||||
9
zone/lua_general.h
Normal file
9
zone/lua_general.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef EQEMU_LUA_GENERAL_H
|
||||
#define EQEMU_LUA_GENERAL_H
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
luabind::scope lua_register_general();
|
||||
luabind::scope lua_register_events();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
1140
zone/lua_item.cpp
1140
zone/lua_item.cpp
File diff suppressed because it is too large
Load Diff
197
zone/lua_item.h
197
zone/lua_item.h
@ -6,10 +6,17 @@
|
||||
|
||||
struct Item_Struct;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_item();
|
||||
|
||||
class Lua_Item : public Lua_Ptr<const void>
|
||||
{
|
||||
typedef Item_Struct NativeType;
|
||||
typedef const Item_Struct NativeType;
|
||||
public:
|
||||
Lua_Item(uint32 item_id);
|
||||
Lua_Item() { }
|
||||
Lua_Item(const Item_Struct *d) : Lua_Ptr(d) { }
|
||||
virtual ~Lua_Item() { }
|
||||
@ -22,6 +29,194 @@ public:
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int GetMinStatus();
|
||||
int GetItemClass();
|
||||
const char *GetName();
|
||||
const char *GetLore();
|
||||
const char *GetIDFile();
|
||||
uint32 GetID();
|
||||
int GetWeight();
|
||||
int GetNoRent();
|
||||
int GetNoDrop();
|
||||
int GetSize();
|
||||
uint32 GetSlots();
|
||||
uint32 GetPrice();
|
||||
uint32 GetIcon();
|
||||
uint32 GetLoreGroup();
|
||||
bool GetLoreFlag();
|
||||
bool GetPendingLoreFlag();
|
||||
bool GetArtifactFlag();
|
||||
bool GetSummonedFlag();
|
||||
int GetFVNoDrop();
|
||||
uint32 GetFavor();
|
||||
uint32 GetGuildFavor();
|
||||
uint32 GetPointType();
|
||||
int GetBagType();
|
||||
int GetBagSlots();
|
||||
int GetBagSize();
|
||||
int GetBagWR();
|
||||
bool GetBenefitFlag();
|
||||
bool GetTradeskills();
|
||||
int GetCR();
|
||||
int GetDR();
|
||||
int GetPR();
|
||||
int GetMR();
|
||||
int GetFR();
|
||||
int GetAStr();
|
||||
int GetASta();
|
||||
int GetAAgi();
|
||||
int GetADex();
|
||||
int GetACha();
|
||||
int GetAInt();
|
||||
int GetAWis();
|
||||
int GetHP();
|
||||
int GetMana();
|
||||
int GetAC();
|
||||
uint32 GetDeity();
|
||||
int GetSkillModValue();
|
||||
uint32 GetSkillModType();
|
||||
uint32 GetBaneDmgRace();
|
||||
int GetBaneDmgAmt();
|
||||
uint32 GetBaneDmgBody();
|
||||
bool GetMagic();
|
||||
int GetCastTime_();
|
||||
int GetReqLevel();
|
||||
uint32 GetBardType();
|
||||
int GetBardValue();
|
||||
int GetLight();
|
||||
int GetDelay();
|
||||
int GetRecLevel();
|
||||
int GetRecSkill();
|
||||
int GetElemDmgType();
|
||||
int GetElemDmgAmt();
|
||||
int GetRange();
|
||||
uint32 GetDamage();
|
||||
uint32 GetColor();
|
||||
uint32 GetClasses();
|
||||
uint32 GetRaces();
|
||||
int GetMaxCharges();
|
||||
int GetItemType();
|
||||
int GetMaterial();
|
||||
double GetSellRate();
|
||||
uint32 GetFulfilment();
|
||||
int GetCastTime();
|
||||
uint32 GetEliteMaterial();
|
||||
int GetProcRate();
|
||||
int GetCombatEffects();
|
||||
int GetShielding();
|
||||
int GetStunResist();
|
||||
int GetStrikeThrough();
|
||||
uint32 GetExtraDmgSkill();
|
||||
uint32 GetExtraDmgAmt();
|
||||
int GetSpellShield();
|
||||
int GetAvoidance();
|
||||
int GetAccuracy();
|
||||
uint32 GetCharmFileID();
|
||||
int GetFactionMod1();
|
||||
int GetFactionMod2();
|
||||
int GetFactionMod3();
|
||||
int GetFactionMod4();
|
||||
int GetFactionAmt1();
|
||||
int GetFactionAmt2();
|
||||
int GetFactionAmt3();
|
||||
int GetFactionAmt4();
|
||||
const char *GetCharmFile();
|
||||
uint32 GetAugType();
|
||||
int GetAugSlotType1();
|
||||
int GetAugSlotType2();
|
||||
int GetAugSlotType3();
|
||||
int GetAugSlotType4();
|
||||
int GetAugSlotType5();
|
||||
int GetAugSlotVisible1();
|
||||
int GetAugSlotVisible2();
|
||||
int GetAugSlotVisible3();
|
||||
int GetAugSlotVisible4();
|
||||
int GetAugSlotVisible5();
|
||||
int GetAugSlotUnk21();
|
||||
int GetAugSlotUnk22();
|
||||
int GetAugSlotUnk23();
|
||||
int GetAugSlotUnk24();
|
||||
int GetAugSlotUnk25();
|
||||
uint32 GetLDoNTheme();
|
||||
uint32 GetLDoNPrice();
|
||||
uint32 GetLDoNSold();
|
||||
uint32 GetBaneDmgRaceAmt();
|
||||
uint32 GetAugRestrict();
|
||||
uint32 GetEndur();
|
||||
uint32 GetDotShielding();
|
||||
uint32 GetAttack();
|
||||
uint32 GetRegen();
|
||||
uint32 GetManaRegen();
|
||||
uint32 GetEnduranceRegen();
|
||||
uint32 GetHaste();
|
||||
uint32 GetDamageShield();
|
||||
uint32 GetRecastDelay();
|
||||
uint32 GetRecastType();
|
||||
uint32 GetAugDistiller();
|
||||
bool GetAttuneable();
|
||||
bool GetNoPet();
|
||||
bool GetPotionBelt();
|
||||
bool GetStackable();
|
||||
bool GetNoTransfer();
|
||||
bool GetQuestItemFlag();
|
||||
int GetStackSize();
|
||||
int GetPotionBeltSlots();
|
||||
int GetClick_Effect();
|
||||
int GetClick_Type();
|
||||
int GetClick_Level();
|
||||
int GetClick_Level2();
|
||||
int GetProc_Effect();
|
||||
int GetProc_Type();
|
||||
int GetProc_Level();
|
||||
int GetProc_Level2();
|
||||
int GetWorn_Effect();
|
||||
int GetWorn_Type();
|
||||
int GetWorn_Level();
|
||||
int GetWorn_Level2();
|
||||
int GetFocus_Effect();
|
||||
int GetFocus_Type();
|
||||
int GetFocus_Level();
|
||||
int GetFocus_Level2();
|
||||
int GetScroll_Effect();
|
||||
int GetScroll_Type();
|
||||
int GetScroll_Level();
|
||||
int GetScroll_Level2();
|
||||
int GetBard_Effect();
|
||||
int GetBard_Type();
|
||||
int GetBard_Level();
|
||||
int GetBard_Level2();
|
||||
int GetBook();
|
||||
uint32 GetBookType();
|
||||
const char *GetFilename();
|
||||
int GetSVCorruption();
|
||||
uint32 GetPurity();
|
||||
uint32 GetBackstabDmg();
|
||||
uint32 GetDSMitigation();
|
||||
int GetHeroicStr();
|
||||
int GetHeroicInt();
|
||||
int GetHeroicWis();
|
||||
int GetHeroicAgi();
|
||||
int GetHeroicDex();
|
||||
int GetHeroicSta();
|
||||
int GetHeroicCha();
|
||||
int GetHeroicMR();
|
||||
int GetHeroicFR();
|
||||
int GetHeroicCR();
|
||||
int GetHeroicDR();
|
||||
int GetHeroicPR();
|
||||
int GetHeroicSVCorrup();
|
||||
int GetHealAmt();
|
||||
int GetSpellDmg();
|
||||
uint32 GetLDoNSellBackRate();
|
||||
uint32 GetScriptFileID();
|
||||
int GetExpendableArrow();
|
||||
uint32 GetClairvoyance();
|
||||
const char *GetClickName();
|
||||
const char *GetProcName();
|
||||
const char *GetWornName();
|
||||
const char *GetFocusName();
|
||||
const char *GetScrollName();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -2,5 +2,288 @@
|
||||
|
||||
#include "masterentity.h"
|
||||
#include "lua_iteminst.h"
|
||||
#include "lua_item.h"
|
||||
#include "lua_entity.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
bool Lua_ItemInst::IsType(int item_class) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsType(static_cast<ItemClass>(item_class));
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsStackable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsStackable();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsEquipable(int race, int class_) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEquipable(race, class_);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsEquipable(int slot_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsEquipable(slot_id);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAugmentable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAugmentable();
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetAugmentType() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAugmentType();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsExpendable() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsExpendable();
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_ItemInst::GetItem(int slot) {
|
||||
Lua_Safe_Call_ItemInst();
|
||||
return Lua_ItemInst(self->GetItem(slot));
|
||||
}
|
||||
|
||||
Lua_Item Lua_ItemInst::GetItem() {
|
||||
Lua_Safe_Call_Item();
|
||||
return Lua_Item(self->GetItem());
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetItem(Lua_Item item) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetItem(item);
|
||||
}
|
||||
|
||||
Lua_Item Lua_ItemInst::GetUnscaledItem(int slot) {
|
||||
Lua_Safe_Call_Item();
|
||||
if(self->IsScaling()) {
|
||||
const EvoItemInst *ev = reinterpret_cast<const EvoItemInst*>(self);
|
||||
return Lua_Item(ev->GetUnscaledItem());
|
||||
}
|
||||
return Lua_Item(self->GetItem());
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetItemID(int slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemID(slot);
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetTotalItemCount() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetTotalItemCount();
|
||||
}
|
||||
|
||||
Lua_ItemInst Lua_ItemInst::GetAugment(int slot) {
|
||||
Lua_Safe_Call_ItemInst();
|
||||
return self->GetAugment(slot);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetAugmentItemID(int slot) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetAugmentItemID(slot);
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAugmented() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAugmented();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsWeapon() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsWeapon();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsAmmo() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsAmmo();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetID();
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetItemScriptID() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetItemScriptID();
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetCharges() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetCharges();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCharges(int charges) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetCharges(charges);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetPrice() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetPrice();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetPrice(uint32 price) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetPrice(price);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetColor(uint32 color) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetColor(color);
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetColor() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetColor();
|
||||
}
|
||||
|
||||
bool Lua_ItemInst::IsInstNoDrop() {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->IsInstNoDrop();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetInstNoDrop(bool flag) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetInstNoDrop(flag);
|
||||
}
|
||||
|
||||
std::string Lua_ItemInst::GetCustomDataString() {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetCustomDataString();
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, std::string value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, int value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, float value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetCustomData(std::string identifier, bool value) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetCustomData(identifier, value);
|
||||
}
|
||||
|
||||
std::string Lua_ItemInst::GetCustomData(std::string identifier) {
|
||||
Lua_Safe_Call_String();
|
||||
return self->GetCustomData(identifier);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::DeleteCustomData(std::string identifier) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DeleteCustomData(identifier);
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetScale(double scale_factor) {
|
||||
Lua_Safe_Call_Void();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
ev->SetExp(static_cast<uint32>(scale_factor * 10000.0 + 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetExp() {
|
||||
Lua_Safe_Call_Int();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
return ev->GetExp();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Lua_ItemInst::SetExp(uint32 exp) {
|
||||
Lua_Safe_Call_Void();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
ev->SetExp(exp);
|
||||
}
|
||||
}
|
||||
|
||||
void Lua_ItemInst::AddExp(uint32 exp) {
|
||||
Lua_Safe_Call_Void();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
ev->AddExp(exp);
|
||||
}
|
||||
}
|
||||
|
||||
int Lua_ItemInst::GetMaxEvolveLvl() {
|
||||
Lua_Safe_Call_Int();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
return ev->GetMaxEvolveLvl();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 Lua_ItemInst::GetKillsNeeded(int current_level) {
|
||||
Lua_Safe_Call_Int();
|
||||
if(self->IsScaling()) {
|
||||
EvoItemInst *ev = reinterpret_cast<EvoItemInst*>(self);
|
||||
return ev->GetKillsNeeded(current_level);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_iteminst() {
|
||||
return luabind::class_<Lua_ItemInst>("ItemInst")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_ItemInst::Null)
|
||||
.property("valid", &Lua_ItemInst::Valid)
|
||||
.def("IsType", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsType)
|
||||
.def("IsStackable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsStackable)
|
||||
.def("IsEquipable", (bool(Lua_ItemInst::*)(int,int))&Lua_ItemInst::IsEquipable)
|
||||
.def("IsEquipable", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsEquipable)
|
||||
.def("IsAugmentable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmentable)
|
||||
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
|
||||
.def("IsExpendable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsExpendable)
|
||||
.def("GetItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItem)
|
||||
.def("GetUnscaledItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetUnscaledItem)
|
||||
.def("GetItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItemID)
|
||||
.def("GetTotalItemCount", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetTotalItemCount)
|
||||
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
|
||||
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
|
||||
.def("IsAugmented", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmented)
|
||||
.def("IsWeapon", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsWeapon)
|
||||
.def("IsAmmo", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAmmo)
|
||||
.def("GetID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetID)
|
||||
.def("GetItemScriptID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItemScriptID)
|
||||
.def("GetItem", (Lua_Item(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItem)
|
||||
.def("SetItem", (void(Lua_ItemInst::*)(Lua_Item))&Lua_ItemInst::SetItem)
|
||||
.def("GetCharges", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCharges)
|
||||
.def("SetCharges", (void(Lua_ItemInst::*)(int))&Lua_ItemInst::SetCharges)
|
||||
.def("GetPrice", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetPrice)
|
||||
.def("SetPrice", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetPrice)
|
||||
.def("SetColor", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetColor)
|
||||
.def("GetColor", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetColor)
|
||||
.def("IsInstNoDrop", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsInstNoDrop)
|
||||
.def("SetInstNoDrop", (void(Lua_ItemInst::*)(bool))&Lua_ItemInst::SetInstNoDrop)
|
||||
.def("GetCustomDataString", (std::string(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCustomDataString)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,std::string))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,int))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,float))&Lua_ItemInst::SetCustomData)
|
||||
.def("SetCustomData", (void(Lua_ItemInst::*)(std::string,bool))&Lua_ItemInst::SetCustomData)
|
||||
.def("GetCustomData", (std::string(Lua_ItemInst::*)(std::string))&Lua_ItemInst::GetCustomData)
|
||||
.def("DeleteCustomData", (void(Lua_ItemInst::*)(std::string))&Lua_ItemInst::DeleteCustomData)
|
||||
.def("SetScale", (void(Lua_ItemInst::*)(void))&Lua_ItemInst::SetScale)
|
||||
.def("GetExp", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetExp)
|
||||
.def("SetExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetExp)
|
||||
.def("AddExp", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::AddExp)
|
||||
.def("GetMaxEvolveLvl", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetMaxEvolveLvl)
|
||||
.def("GetKillsNeeded", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetKillsNeeded);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,13 @@
|
||||
#include "lua_ptr.h"
|
||||
|
||||
class ItemInst;
|
||||
class Lua_Item;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_iteminst();
|
||||
|
||||
class Lua_ItemInst : public Lua_Ptr<void>
|
||||
{
|
||||
@ -22,6 +29,48 @@ public:
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool IsType(int item_class);
|
||||
bool IsStackable();
|
||||
bool IsEquipable(int race, int class_);
|
||||
bool IsEquipable(int slot_id);
|
||||
bool IsAugmentable();
|
||||
int GetAugmentType();
|
||||
bool IsExpendable();
|
||||
Lua_ItemInst GetItem(int slot);
|
||||
Lua_Item GetItem();
|
||||
void SetItem(Lua_Item item);
|
||||
Lua_Item GetUnscaledItem(int slot);
|
||||
uint32 GetItemID(int slot);
|
||||
int GetTotalItemCount();
|
||||
Lua_ItemInst GetAugment(int slot);
|
||||
uint32 GetAugmentItemID(int slot);
|
||||
bool IsAugmented();
|
||||
bool IsWeapon();
|
||||
bool IsAmmo();
|
||||
uint32 GetID();
|
||||
uint32 GetItemScriptID();
|
||||
int GetCharges();
|
||||
void SetCharges(int charges);
|
||||
uint32 GetPrice();
|
||||
void SetPrice(uint32 price);
|
||||
void SetColor(uint32 color);
|
||||
uint32 GetColor();
|
||||
bool IsInstNoDrop();
|
||||
void SetInstNoDrop(bool flag);
|
||||
std::string GetCustomDataString();
|
||||
void SetCustomData(std::string identifier, std::string value);
|
||||
void SetCustomData(std::string identifier, int value);
|
||||
void SetCustomData(std::string identifier, float value);
|
||||
void SetCustomData(std::string identifier, bool value);
|
||||
std::string GetCustomData(std::string identifier);
|
||||
void DeleteCustomData(std::string identifier);
|
||||
void SetScale(double scale_factor);
|
||||
uint32 GetExp();
|
||||
void SetExp(uint32 exp);
|
||||
void AddExp(uint32 exp);
|
||||
int GetMaxEvolveLvl();
|
||||
uint32 GetKillsNeeded(int current_level);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
301
zone/lua_mob.cpp
301
zone/lua_mob.cpp
@ -8,6 +8,9 @@
|
||||
#include "lua_hate_list.h"
|
||||
#include "lua_client.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
Lua_Mob::Lua_Illusion::Lua_Illusion() {
|
||||
in_race = 0;
|
||||
in_gender = 255;
|
||||
@ -1548,4 +1551,302 @@ int Lua_Mob::GetFlurryChance() {
|
||||
return self->GetFlurryChance();
|
||||
}
|
||||
|
||||
luabind::scope lua_register_mob() {
|
||||
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
||||
.def(luabind::constructor<>())
|
||||
.def("GetName", &Lua_Mob::GetName)
|
||||
.def("Depop", (void(Lua_Mob::*)(void))&Lua_Mob::Depop)
|
||||
.def("Depop", (void(Lua_Mob::*)(bool))&Lua_Mob::Depop)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(void))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob,float))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob,float,float))&Lua_Mob::BehindMob)
|
||||
.def("SetLevel", (void(Lua_Mob::*)(int))&Lua_Mob::SetLevel)
|
||||
.def("SetLevel", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetLevel)
|
||||
.def("IsMoving", &Lua_Mob::IsMoving)
|
||||
.def("GotoBind", &Lua_Mob::GotoBind)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool,bool))&Lua_Mob::Attack)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int,bool))&Lua_Mob::Damage)
|
||||
.def("RangedAttack", &Lua_Mob::RangedAttack)
|
||||
.def("ThrowingAttack", &Lua_Mob::ThrowingAttack)
|
||||
.def("Heal", &Lua_Mob::Heal)
|
||||
.def("HealDamage", (void(Lua_Mob::*)(uint32))&Lua_Mob::HealDamage)
|
||||
.def("HealDamage", (void(Lua_Mob::*)(uint32,Lua_Mob))&Lua_Mob::HealDamage)
|
||||
.def("GetLevelCon", (uint32(Lua_Mob::*)(int))&Lua_Mob::GetLevelCon)
|
||||
.def("GetLevelCon", (uint32(Lua_Mob::*)(int,int))&Lua_Mob::GetLevelCon)
|
||||
.def("SetHP", &Lua_Mob::SetHP)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int,bool))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int,bool,int))&Lua_Mob::DoAnim)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double))&Lua_Mob::ChangeSize)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double,bool))&Lua_Mob::ChangeSize)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::GMMove)
|
||||
.def("HasProcs", &Lua_Mob::HasProcs)
|
||||
.def("IsInvisible", (bool(Lua_Mob::*)(void))&Lua_Mob::IsInvisible)
|
||||
.def("IsInvisible", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsInvisible)
|
||||
.def("SetInvisible", &Lua_Mob::SetInvisible)
|
||||
.def("FindBuff", &Lua_Mob::FindBuff)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool,int))&Lua_Mob::FindType)
|
||||
.def("GetBuffSlotFromType", &Lua_Mob::GetBuffSlotFromType)
|
||||
.def("GetBaseRace", &Lua_Mob::GetBaseRace)
|
||||
.def("GetBaseGender", &Lua_Mob::GetBaseGender)
|
||||
.def("GetDeity", &Lua_Mob::GetDeity)
|
||||
.def("GetRace", &Lua_Mob::GetRace)
|
||||
.def("GetGender", &Lua_Mob::GetGender)
|
||||
.def("GetTexture", &Lua_Mob::GetTexture)
|
||||
.def("GetHelmTexture", &Lua_Mob::GetHelmTexture)
|
||||
.def("GetHairColor", &Lua_Mob::GetHairColor)
|
||||
.def("GetBeardColor", &Lua_Mob::GetBeardColor)
|
||||
.def("GetEyeColor1", &Lua_Mob::GetEyeColor1)
|
||||
.def("GetEyeColor2", &Lua_Mob::GetEyeColor2)
|
||||
.def("GetHairStyle", &Lua_Mob::GetHairStyle)
|
||||
.def("GetLuclinFace", &Lua_Mob::GetLuclinFace)
|
||||
.def("GetBeard", &Lua_Mob::GetBeard)
|
||||
.def("GetDrakkinHeritage", &Lua_Mob::GetDrakkinHeritage)
|
||||
.def("GetDrakkinTattoo", &Lua_Mob::GetDrakkinTattoo)
|
||||
.def("GetDrakkinDetails", &Lua_Mob::GetDrakkinDetails)
|
||||
.def("GetClass", &Lua_Mob::GetClass)
|
||||
.def("GetLevel", &Lua_Mob::GetLevel)
|
||||
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
||||
.def("GetTarget", &Lua_Mob::GetTarget)
|
||||
.def("SetTarget", &Lua_Mob::SetTarget)
|
||||
.def("GetHPRatio", &Lua_Mob::GetHPRatio)
|
||||
.def("IsWarriorClass", &Lua_Mob::IsWarriorClass)
|
||||
.def("GetHP", &Lua_Mob::GetHP)
|
||||
.def("GetMaxHP", &Lua_Mob::GetMaxHP)
|
||||
.def("GetItemHPBonuses", &Lua_Mob::GetItemHPBonuses)
|
||||
.def("GetSpellHPBonuses", &Lua_Mob::GetSpellHPBonuses)
|
||||
.def("GetWalkspeed", &Lua_Mob::GetWalkspeed)
|
||||
.def("GetRunspeed", &Lua_Mob::GetRunspeed)
|
||||
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
||||
.def("GetMaxMana", &Lua_Mob::GetMaxMana)
|
||||
.def("GetMana", &Lua_Mob::GetMana)
|
||||
.def("SetMana", &Lua_Mob::SetMana)
|
||||
.def("GetManaRatio", &Lua_Mob::GetManaRatio)
|
||||
.def("GetAC", &Lua_Mob::GetAC)
|
||||
.def("GetATK", &Lua_Mob::GetATK)
|
||||
.def("GetSTR", &Lua_Mob::GetSTR)
|
||||
.def("GetSTA", &Lua_Mob::GetSTA)
|
||||
.def("GetDEX", &Lua_Mob::GetDEX)
|
||||
.def("GetAGI", &Lua_Mob::GetAGI)
|
||||
.def("GetINT", &Lua_Mob::GetINT)
|
||||
.def("GetWIS", &Lua_Mob::GetWIS)
|
||||
.def("GetCHA", &Lua_Mob::GetCHA)
|
||||
.def("GetMR", &Lua_Mob::GetMR)
|
||||
.def("GetFR", &Lua_Mob::GetFR)
|
||||
.def("GetDR", &Lua_Mob::GetDR)
|
||||
.def("GetPR", &Lua_Mob::GetPR)
|
||||
.def("GetCR", &Lua_Mob::GetCR)
|
||||
.def("GetCorruption", &Lua_Mob::GetCorruption)
|
||||
.def("GetMaxSTR", &Lua_Mob::GetMaxSTR)
|
||||
.def("GetMaxSTA", &Lua_Mob::GetMaxSTA)
|
||||
.def("GetMaxDEX", &Lua_Mob::GetMaxDEX)
|
||||
.def("GetMaxAGI", &Lua_Mob::GetMaxAGI)
|
||||
.def("GetMaxINT", &Lua_Mob::GetMaxINT)
|
||||
.def("GetMaxWIS", &Lua_Mob::GetMaxWIS)
|
||||
.def("GetMaxCHA", &Lua_Mob::GetMaxCHA)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool,int))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool,int,bool))&Lua_Mob::ResistSpell)
|
||||
.def("GetSpecializeSkillValue", &Lua_Mob::GetSpecializeSkillValue)
|
||||
.def("GetNPCTypeID", &Lua_Mob::GetNPCTypeID)
|
||||
.def("IsTargeted", &Lua_Mob::IsTargeted)
|
||||
.def("GetX", &Lua_Mob::GetX)
|
||||
.def("GetY", &Lua_Mob::GetY)
|
||||
.def("GetZ", &Lua_Mob::GetZ)
|
||||
.def("GetHeading", &Lua_Mob::GetHeading)
|
||||
.def("GetWaypointX", &Lua_Mob::GetWaypointX)
|
||||
.def("GetWaypointY", &Lua_Mob::GetWaypointY)
|
||||
.def("GetWaypointZ", &Lua_Mob::GetWaypointZ)
|
||||
.def("GetWaypointH", &Lua_Mob::GetWaypointH)
|
||||
.def("GetWaypointPause", &Lua_Mob::GetWaypointPause)
|
||||
.def("GetWaypointID", &Lua_Mob::GetWaypointID)
|
||||
.def("SetCurrentWP", &Lua_Mob::SetCurrentWP)
|
||||
.def("GetSize", &Lua_Mob::GetSize)
|
||||
.def("Message", &Lua_Mob::Message)
|
||||
.def("Message_StringID", &Lua_Mob::Message_StringID)
|
||||
.def("Say", &Lua_Mob::Say)
|
||||
.def("Shout", &Lua_Mob::Shout)
|
||||
.def("Emote", &Lua_Mob::Emote)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(int))&Lua_Mob::InterruptSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int,bool))&Lua_Mob::SpellFinished)
|
||||
.def("SpellEffect", &Lua_Mob::SpellEffect)
|
||||
.def("GetHateList", &Lua_Mob::GetHateList)
|
||||
.def("GetHateTop", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateTop)
|
||||
.def("GetHateDamageTop", (Lua_Mob(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateDamageTop)
|
||||
.def("GetHateRandom", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateRandom)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool,bool))&Lua_Mob::AddToHateList)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::SetHate)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::SetHate)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::SetHate)
|
||||
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount)
|
||||
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount)
|
||||
.def("GetDamageAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetDamageAmount)
|
||||
.def("WipeHateList", (void(Lua_Mob::*)(void))&Lua_Mob::WipeHateList)
|
||||
.def("CheckAggro", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckAggro)
|
||||
.def("Stun", (void(Lua_Mob::*)(int))&Lua_Mob::Stun)
|
||||
.def("UnStun", (void(Lua_Mob::*)(void))&Lua_Mob::UnStun)
|
||||
.def("IsStunned", (bool(Lua_Mob::*)(void))&Lua_Mob::IsStunned)
|
||||
.def("Spin", (void(Lua_Mob::*)(void))&Lua_Mob::Spin)
|
||||
.def("Kill", (void(Lua_Mob::*)(void))&Lua_Mob::Kill)
|
||||
.def("CanThisClassDoubleAttack", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDoubleAttack)
|
||||
.def("CanThisClassDualWield", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDualWield)
|
||||
.def("CanThisClassRiposte", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassRiposte)
|
||||
.def("CanThisClassDodge", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDodge)
|
||||
.def("CanThisClassParry", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassParry)
|
||||
.def("CanThisClassBlock", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassBlock)
|
||||
.def("SetInvul", (void(Lua_Mob::*)(bool))&Lua_Mob::SetInvul)
|
||||
.def("GetInvul", (bool(Lua_Mob::*)(void))&Lua_Mob::GetInvul)
|
||||
.def("SetExtraHaste", (void(Lua_Mob::*)(int))&Lua_Mob::SetExtraHaste)
|
||||
.def("GetHaste", (int(Lua_Mob::*)(void))&Lua_Mob::GetHaste)
|
||||
.def("GetMonkHandToHandDamage", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDamage)
|
||||
.def("GetMonkHandToHandDelay", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDelay)
|
||||
.def("Mesmerize", (void(Lua_Mob::*)(void))&Lua_Mob::Mesmerize)
|
||||
.def("IsMezzed", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMezzed)
|
||||
.def("IsEnraged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEnraged)
|
||||
.def("GetReverseFactionCon", (int(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetReverseFactionCon)
|
||||
.def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled)
|
||||
.def("GetAggroRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAggroRange)
|
||||
.def("GetAssistRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAssistRange)
|
||||
.def("SetPetOrder", (void(Lua_Mob::*)(int))&Lua_Mob::SetPetOrder)
|
||||
.def("GetPetOrder", (int(Lua_Mob::*)(void))&Lua_Mob::GetPetOrder)
|
||||
.def("IsRoamer", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRoamer)
|
||||
.def("IsRooted", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRooted)
|
||||
.def("IsEngaged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEngaged)
|
||||
.def("FaceTarget", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::FaceTarget)
|
||||
.def("SetHeading", (void(Lua_Mob::*)(double))&Lua_Mob::SetHeading)
|
||||
.def("CalculateHeadingToTarget", (double(Lua_Mob::*)(double,double))&Lua_Mob::CalculateHeadingToTarget)
|
||||
.def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition)
|
||||
.def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition)
|
||||
.def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition2)
|
||||
.def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition2)
|
||||
.def("CalculateDistance", (float(Lua_Mob::*)(double,double,double))&Lua_Mob::CalculateDistance)
|
||||
.def("SendTo", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendTo)
|
||||
.def("SendToFixZ", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendToFixZ)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool,bool))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("GetResist", (int(Lua_Mob::*)(int))&Lua_Mob::GetResist)
|
||||
.def("Charmed", (bool(Lua_Mob::*)(void))&Lua_Mob::Charmed)
|
||||
.def("CheckAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckAggroAmount)
|
||||
.def("CheckAggroAmount", (int(Lua_Mob::*)(int,bool))&Lua_Mob::CheckAggroAmount)
|
||||
.def("CheckHealAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckHealAggroAmount)
|
||||
.def("CheckHealAggroAmount", (int(Lua_Mob::*)(int,uint32))&Lua_Mob::CheckHealAggroAmount)
|
||||
.def("GetAA", (int(Lua_Mob::*)(int))&Lua_Mob::GetAA)
|
||||
.def("DivineAura", (bool(Lua_Mob::*)(void))&Lua_Mob::DivineAura)
|
||||
.def("SetOOCRegen", (void(Lua_Mob::*)(int))&Lua_Mob::SetOOCRegen)
|
||||
.def("GetEntityVariable", (const char*(Lua_Mob::*)(const char*))&Lua_Mob::GetEntityVariable)
|
||||
.def("SetEntityVariable", (void(Lua_Mob::*)(const char*,const char*))&Lua_Mob::SetEntityVariable)
|
||||
.def("EntityVariableExists", (bool(Lua_Mob::*)(const char*))&Lua_Mob::EntityVariableExists)
|
||||
.def("Signal", (void(Lua_Mob::*)(uint32))&Lua_Mob::Signal)
|
||||
.def("CombatRange", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CombatRange)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int,bool))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,bool))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("CheckLoS", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckLoS)
|
||||
.def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double))&Lua_Mob::CheckLoSToLoc)
|
||||
.def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CheckLoSToLoc)
|
||||
.def("FindGroundZ", (double(Lua_Mob::*)(double,double))&Lua_Mob::FindGroundZ)
|
||||
.def("FindGroundZ", (double(Lua_Mob::*)(double,double,double))&Lua_Mob::FindGroundZ)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("HasNPCSpecialAtk", (bool(Lua_Mob::*)(const char*))&Lua_Mob::HasNPCSpecialAtk)
|
||||
.def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32))&Lua_Mob::SendAppearanceEffect)
|
||||
.def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32,Lua_Client))&Lua_Mob::SendAppearanceEffect)
|
||||
.def("SetFlyMode", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlyMode)
|
||||
.def("SetTexture", (void(Lua_Mob::*)(int))&Lua_Mob::SetTexture)
|
||||
.def("SetRace", (void(Lua_Mob::*)(int))&Lua_Mob::SetRace)
|
||||
.def("SetGender", (void(Lua_Mob::*)(int))&Lua_Mob::SetGender)
|
||||
.def("SendIllusionPacket", (void(Lua_Mob::*)(Lua_Mob::Lua_Illusion))&Lua_Mob::SendIllusionPacket)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32,uint32))&Lua_Mob::QuestReward)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32))&Lua_Mob::CameraEffect)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client))&Lua_Mob::CameraEffect)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client,bool))&Lua_Mob::CameraEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32))&Lua_Mob::SendSpellEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool))&Lua_Mob::SendSpellEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool,Lua_Client))&Lua_Mob::SendSpellEffect)
|
||||
.def("TempName", (void(Lua_Mob::*)(void))&Lua_Mob::TempName)
|
||||
.def("TempName", (void(Lua_Mob::*)(const char*))&Lua_Mob::TempName)
|
||||
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*))&Lua_Mob::SetGlobal)
|
||||
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*,Lua_Mob))&Lua_Mob::SetGlobal)
|
||||
.def("TarGlobal", (void(Lua_Mob::*)(const char*,const char*,const char*,int,int,int))&Lua_Mob::TarGlobal)
|
||||
.def("DelGlobal", (void(Lua_Mob::*)(const char*))&Lua_Mob::DelGlobal)
|
||||
.def("SetSlotTint", (void(Lua_Mob::*)(int,int,int,int))&Lua_Mob::SetSlotTint)
|
||||
.def("WearChange", (void(Lua_Mob::*)(int,int,uint32))&Lua_Mob::WearChange)
|
||||
.def("DoKnockback", (void(Lua_Mob::*)(Lua_Mob,uint32,uint32))&Lua_Mob::DoKnockback)
|
||||
.def("RemoveNimbusEffect", (void(Lua_Mob::*)(int))&Lua_Mob::RemoveNimbusEffect)
|
||||
.def("IsRunning", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRunning)
|
||||
.def("SetRunning", (void(Lua_Mob::*)(bool))&Lua_Mob::SetRunning)
|
||||
.def("SetBodyType", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetBodyType)
|
||||
.def("SetTargetable", (void(Lua_Mob::*)(bool))&Lua_Mob::SetTargetable)
|
||||
.def("ModSkillDmgTaken", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModSkillDmgTaken)
|
||||
.def("GetModSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetModSkillDmgTaken)
|
||||
.def("GetSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetSkillDmgTaken)
|
||||
.def("SetAllowBeneficial", (void(Lua_Mob::*)(bool))&Lua_Mob::SetAllowBeneficial)
|
||||
.def("GetAllowBeneficial", (bool(Lua_Mob::*)(void))&Lua_Mob::GetAllowBeneficial)
|
||||
.def("IsBeneficialAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsBeneficialAllowed)
|
||||
.def("ModVulnerability", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModVulnerability)
|
||||
.def("GetModVulnerability", (int(Lua_Mob::*)(int))&Lua_Mob::GetModVulnerability)
|
||||
.def("SetDisableMelee", (void(Lua_Mob::*)(bool))&Lua_Mob::SetDisableMelee)
|
||||
.def("IsMeleeDisabled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMeleeDisabled)
|
||||
.def("SetFlurryChance", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlurryChance)
|
||||
.def("GetFlurryChance", (int(Lua_Mob::*)(void))&Lua_Mob::GetFlurryChance);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -9,6 +9,12 @@ struct Lua_HateList;
|
||||
class Lua_Item;
|
||||
class Lua_ItemInst;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_mob();
|
||||
|
||||
class Lua_Mob : public Lua_Entity
|
||||
{
|
||||
typedef Mob NativeType;
|
||||
|
||||
@ -3,6 +3,12 @@
|
||||
#include "masterentity.h"
|
||||
#include "lua_npc.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
luabind::scope lua_register_npc() {
|
||||
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
|
||||
.def(luabind::constructor<>());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,11 @@
|
||||
#include "lua_mob.h"
|
||||
|
||||
class NPC;
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_npc();
|
||||
|
||||
class Lua_NPC : public Lua_Mob
|
||||
{
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#include "lua_client.h"
|
||||
#include "lua_npc.h"
|
||||
#include "lua_spell.h"
|
||||
#include "lua_general.h"
|
||||
#include "zone.h"
|
||||
|
||||
#include "lua_parser.h"
|
||||
@ -84,11 +85,21 @@ const char *LuaEvents[_LargestEventID] = {
|
||||
"event_connect",
|
||||
"event_item_tick",
|
||||
"event_duel_win",
|
||||
"event_duel_lose"
|
||||
"event_duel_lose",
|
||||
"event_encounter_load",
|
||||
"event_encounter_unload"
|
||||
};
|
||||
|
||||
extern Zone *zone;
|
||||
|
||||
struct lua_registered_event {
|
||||
std::string encounter_name;
|
||||
luabind::object lua_reference;
|
||||
QuestEventID event_id;
|
||||
};
|
||||
|
||||
std::map<std::string, std::list<lua_registered_event>> lua_encounter_events_registered;
|
||||
|
||||
LuaParser::LuaParser() {
|
||||
for(int i = 0; i < _LargestEventID; ++i) {
|
||||
NPCArgumentDispatch[i] = handle_npc_null;
|
||||
@ -165,14 +176,21 @@ int LuaParser::EventGlobalNPC(QuestEventID evt, NPC* npc, Mob *init, std::string
|
||||
return _EventNPC("global_npc", evt, npc, init, data, extra_data);
|
||||
}
|
||||
|
||||
int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
luabind::object *l_func) {
|
||||
const char *sub_name = LuaEvents[evt];
|
||||
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
int npop = 1;
|
||||
if(l_func != nullptr) {
|
||||
l_func->push(L);
|
||||
} else {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
npop = 2;
|
||||
}
|
||||
|
||||
lua_createtable(L, 0, 0);
|
||||
//always push self
|
||||
@ -185,19 +203,22 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
||||
arg_function(this, L, npc, init, data, extra_data);
|
||||
|
||||
if(lua_pcall(L, 1, 1, 0)) {
|
||||
printf("Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(lua_isnumber(L, -1)) {
|
||||
int ret = static_cast<int>(lua_tointeger(L, -1));
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
return ret;
|
||||
}
|
||||
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
} catch(std::exception &ex) {
|
||||
printf("Lua call exception: %s\n", ex.what());
|
||||
std::string error = "Lua Exception: ";
|
||||
error += std::string(ex.what());
|
||||
AddError(error);
|
||||
|
||||
//Restore our stack to the best of our ability
|
||||
int end = lua_gettop(L);
|
||||
@ -242,13 +263,20 @@ int LuaParser::EventGlobalPlayer(QuestEventID evt, Client *client, std::string d
|
||||
return _EventPlayer("global_player", evt, client, data, extra_data);
|
||||
}
|
||||
|
||||
int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
luabind::object *l_func) {
|
||||
const char *sub_name = LuaEvents[evt];
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
int npop = 1;
|
||||
if(l_func != nullptr) {
|
||||
l_func->push(L);
|
||||
} else {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
npop = 2;
|
||||
}
|
||||
|
||||
lua_createtable(L, 0, 0);
|
||||
//push self
|
||||
@ -261,19 +289,22 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
||||
arg_function(this, L, client, data, extra_data);
|
||||
|
||||
if(lua_pcall(L, 1, 1, 0)) {
|
||||
printf("Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(lua_isnumber(L, -1)) {
|
||||
int ret = static_cast<int>(lua_tointeger(L, -1));
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
return ret;
|
||||
}
|
||||
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
} catch(std::exception &ex) {
|
||||
printf("Lua call exception: %s\n", ex.what());
|
||||
std::string error = "Lua Exception: ";
|
||||
error += std::string(ex.what());
|
||||
AddError(error);
|
||||
|
||||
//Restore our stack to the best of our ability
|
||||
int end = lua_gettop(L);
|
||||
@ -323,14 +354,20 @@ int LuaParser::EventItem(QuestEventID evt, Client *client, ItemInst *item, uint3
|
||||
return _EventItem(package_name.str(), evt, client, item, objid, extra_data);
|
||||
}
|
||||
|
||||
int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) {
|
||||
int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data,
|
||||
luabind::object *l_func) {
|
||||
const char *sub_name = LuaEvents[evt];
|
||||
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
int npop = 1;
|
||||
if(l_func != nullptr) {
|
||||
l_func->push(L);
|
||||
} else {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
}
|
||||
|
||||
lua_createtable(L, 0, 0);
|
||||
//always push self
|
||||
@ -343,19 +380,22 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
|
||||
arg_function(this, L, client, item, objid, extra_data);
|
||||
|
||||
if(lua_pcall(L, 1, 1, 0)) {
|
||||
printf("Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(lua_isnumber(L, -1)) {
|
||||
int ret = static_cast<int>(lua_tointeger(L, -1));
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
return ret;
|
||||
}
|
||||
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, npop);
|
||||
} catch(std::exception &ex) {
|
||||
printf("Lua call exception: %s\n", ex.what());
|
||||
std::string error = "Lua Exception: ";
|
||||
error += std::string(ex.what());
|
||||
AddError(error);
|
||||
|
||||
//Restore our stack to the best of our ability
|
||||
int end = lua_gettop(L);
|
||||
@ -383,14 +423,21 @@ int LuaParser::EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spe
|
||||
return _EventSpell(package_name.str(), evt, npc, client, spell_id, extra_data);
|
||||
}
|
||||
|
||||
int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) {
|
||||
int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
|
||||
luabind::object *l_func) {
|
||||
const char *sub_name = LuaEvents[evt];
|
||||
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
int npop = 1;
|
||||
if(l_func != nullptr) {
|
||||
l_func->push(L);
|
||||
} else {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
npop = 2;
|
||||
}
|
||||
|
||||
lua_createtable(L, 0, 0);
|
||||
|
||||
@ -404,7 +451,63 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc,
|
||||
arg_function(this, L, npc, client, spell_id, extra_data);
|
||||
|
||||
if(lua_pcall(L, 1, 1, 0)) {
|
||||
printf("Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(lua_isnumber(L, -1)) {
|
||||
int ret = static_cast<int>(lua_tointeger(L, -1));
|
||||
lua_pop(L, npop);
|
||||
return ret;
|
||||
}
|
||||
|
||||
lua_pop(L, npop);
|
||||
} catch(std::exception &ex) {
|
||||
std::string error = "Lua Exception: ";
|
||||
error += std::string(ex.what());
|
||||
AddError(error);
|
||||
|
||||
//Restore our stack to the best of our ability
|
||||
int end = lua_gettop(L);
|
||||
int n = end - start;
|
||||
if(n > 0) {
|
||||
lua_pop(L, n);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaParser::EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data) {
|
||||
if(evt >= _LargestEventID) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string package_name = "encounter_" + encounter_name;
|
||||
|
||||
if(!EncounterHasQuestSub(encounter_name, LuaEvents[evt])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _EventEncounter(package_name, evt, encounter_name, extra_data);
|
||||
}
|
||||
|
||||
int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::string encounter_name, uint32 extra_data) {
|
||||
const char *sub_name = LuaEvents[evt];
|
||||
|
||||
int start = lua_gettop(L);
|
||||
|
||||
try {
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||
lua_getfield(L, -1, sub_name);
|
||||
|
||||
//For now encounters just call event_encounter_load/event_encounter_unload with no arguments
|
||||
//So we dont pass anything
|
||||
|
||||
if(lua_pcall(L, 0, 1, 0)) {
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -416,7 +519,9 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc,
|
||||
|
||||
lua_pop(L, 2);
|
||||
} catch(std::exception &ex) {
|
||||
printf("Lua call exception: %s\n", ex.what());
|
||||
std::string error = "Lua Exception: ";
|
||||
error += std::string(ex.what());
|
||||
AddError(error);
|
||||
|
||||
//Restore our stack to the best of our ability
|
||||
int end = lua_gettop(L);
|
||||
@ -480,6 +585,12 @@ bool LuaParser::ItemHasQuestSub(ItemInst *itm, const char *subname) {
|
||||
return HasFunction(subname, package_name.str());
|
||||
}
|
||||
|
||||
bool LuaParser::EncounterHasQuestSub(std::string encounter_name, const char *subname) {
|
||||
std::string package_name = "encounter_" + encounter_name;
|
||||
|
||||
return HasFunction(subname, package_name);
|
||||
}
|
||||
|
||||
void LuaParser::LoadNPCScript(std::string filename, int npc_id) {
|
||||
std::stringstream package_name;
|
||||
package_name << "npc_" << npc_id;
|
||||
@ -513,6 +624,12 @@ void LuaParser::LoadSpellScript(std::string filename, uint32 spell_id) {
|
||||
LoadScript(filename, package_name.str());
|
||||
}
|
||||
|
||||
void LuaParser::LoadEncounterScript(std::string filename, std::string encounter_name) {
|
||||
std::string package_name = "encounter_" + encounter_name;
|
||||
|
||||
LoadScript(filename, package_name);
|
||||
}
|
||||
|
||||
void LuaParser::AddVar(std::string name, std::string val) {
|
||||
vars_[name] = val;
|
||||
}
|
||||
@ -527,12 +644,14 @@ std::string LuaParser::GetVar(std::string name) {
|
||||
}
|
||||
|
||||
void LuaParser::ReloadQuests() {
|
||||
loaded_.clear();
|
||||
errors_.clear();
|
||||
lua_encounter_events_registered.clear();
|
||||
|
||||
if(L) {
|
||||
lua_close(L);
|
||||
}
|
||||
|
||||
loaded_.clear();
|
||||
|
||||
L = luaL_newstate();
|
||||
luaL_openlibs(L);
|
||||
|
||||
@ -541,22 +660,23 @@ void LuaParser::ReloadQuests() {
|
||||
|
||||
lua_getglobal(L, "package");
|
||||
lua_getfield(L, -1, "path");
|
||||
char module_path[1024] = { 0 };
|
||||
snprintf(module_path, 1023, "%s;%s", lua_tostring(L,-1), "quests/plugins/?.lua");
|
||||
std::string module_path = lua_tostring(L,-1);
|
||||
module_path += "quests/plugins/?.lua";
|
||||
lua_pop(L, 1);
|
||||
lua_pushstring(L, module_path);
|
||||
lua_pushstring(L, module_path.c_str());
|
||||
lua_setfield(L, -2, "path");
|
||||
lua_pop(L, 1);
|
||||
|
||||
MapFunctions(L);
|
||||
|
||||
//load init
|
||||
FILE *f = fopen("quests/global/script_init.lua", "r");
|
||||
if(f) {
|
||||
fclose(f);
|
||||
|
||||
if(luaL_dofile(L, "quests/global/script_init.lua")) {
|
||||
printf("Lua Error in Global Init: %s\n", lua_tostring(L, -1));
|
||||
lua_close(L);
|
||||
return;
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -569,14 +689,11 @@ void LuaParser::ReloadQuests() {
|
||||
fclose(f);
|
||||
|
||||
if(luaL_dofile(L, zone_script.c_str())) {
|
||||
printf("Lua Error in Zone Init: %s\n", lua_tostring(L, -1));
|
||||
lua_close(L);
|
||||
return;
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapFunctions(L);
|
||||
}
|
||||
|
||||
void LuaParser::LoadScript(std::string filename, std::string package_name) {
|
||||
@ -586,7 +703,8 @@ void LuaParser::LoadScript(std::string filename, std::string package_name) {
|
||||
}
|
||||
|
||||
if(luaL_loadfile(L, filename.c_str())) {
|
||||
printf("Lua Load Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
@ -608,7 +726,8 @@ void LuaParser::LoadScript(std::string filename, std::string package_name) {
|
||||
lua_setfenv(L, -2); //set the env to the table we made
|
||||
|
||||
if(lua_pcall(L, 0, 0, 0)) {
|
||||
printf("Lua Load Error: %s\n", lua_tostring(L, -1));
|
||||
std::string error = lua_tostring(L, -1);
|
||||
AddError(error);
|
||||
lua_pop(L, 1);
|
||||
return;
|
||||
}
|
||||
@ -650,342 +769,15 @@ void LuaParser::MapFunctions(lua_State *L) {
|
||||
|
||||
luabind::module(L)
|
||||
[
|
||||
luabind::class_<Lua_Entity>("Entity")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Entity::Null)
|
||||
.property("valid", &Lua_Entity::Valid)
|
||||
.def("IsClient", &Lua_Entity::IsClient)
|
||||
.def("IsNPC", &Lua_Entity::IsNPC)
|
||||
.def("IsMob", &Lua_Entity::IsMob)
|
||||
.def("IsMerc", &Lua_Entity::IsMerc)
|
||||
.def("IsCorpse", &Lua_Entity::IsCorpse)
|
||||
.def("IsPlayerCorpse", &Lua_Entity::IsPlayerCorpse)
|
||||
.def("IsNPCCorpse", &Lua_Entity::IsNPCCorpse)
|
||||
.def("IsObject", &Lua_Entity::IsObject)
|
||||
.def("IsDoor", &Lua_Entity::IsDoor)
|
||||
.def("IsTrap", &Lua_Entity::IsTrap)
|
||||
.def("IsBeacon", &Lua_Entity::IsBeacon)
|
||||
.def("GetID", &Lua_Entity::GetID)
|
||||
.def("CastToClient", &Lua_Entity::CastToClient)
|
||||
.def("CastToNPC", &Lua_Entity::CastToNPC)
|
||||
.def("CastToMob", &Lua_Entity::CastToMob),
|
||||
|
||||
luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
||||
.def(luabind::constructor<>())
|
||||
.def("GetName", &Lua_Mob::GetName)
|
||||
.def("Depop", (void(Lua_Mob::*)(void))&Lua_Mob::Depop)
|
||||
.def("Depop", (void(Lua_Mob::*)(bool))&Lua_Mob::Depop)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(void))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob,float))&Lua_Mob::BehindMob)
|
||||
.def("BehindMob", (bool(Lua_Mob::*)(Lua_Mob,float,float))&Lua_Mob::BehindMob)
|
||||
.def("SetLevel", (void(Lua_Mob::*)(int))&Lua_Mob::SetLevel)
|
||||
.def("SetLevel", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetLevel)
|
||||
.def("IsMoving", &Lua_Mob::IsMoving)
|
||||
.def("GotoBind", &Lua_Mob::GotoBind)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool))&Lua_Mob::Attack)
|
||||
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool,bool))&Lua_Mob::Attack)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int))&Lua_Mob::Damage)
|
||||
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int,bool))&Lua_Mob::Damage)
|
||||
.def("RangedAttack", &Lua_Mob::RangedAttack)
|
||||
.def("ThrowingAttack", &Lua_Mob::ThrowingAttack)
|
||||
.def("Heal", &Lua_Mob::Heal)
|
||||
.def("HealDamage", (void(Lua_Mob::*)(uint32))&Lua_Mob::HealDamage)
|
||||
.def("HealDamage", (void(Lua_Mob::*)(uint32,Lua_Mob))&Lua_Mob::HealDamage)
|
||||
.def("GetLevelCon", (uint32(Lua_Mob::*)(int))&Lua_Mob::GetLevelCon)
|
||||
.def("GetLevelCon", (uint32(Lua_Mob::*)(int,int))&Lua_Mob::GetLevelCon)
|
||||
.def("SetHP", &Lua_Mob::SetHP)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int,bool))&Lua_Mob::DoAnim)
|
||||
.def("DoAnim", (void(Lua_Mob::*)(int,int,bool,int))&Lua_Mob::DoAnim)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double))&Lua_Mob::ChangeSize)
|
||||
.def("ChangeSize", (void(Lua_Mob::*)(double,bool))&Lua_Mob::ChangeSize)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double))&Lua_Mob::GMMove)
|
||||
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::GMMove)
|
||||
.def("HasProcs", &Lua_Mob::HasProcs)
|
||||
.def("IsInvisible", (bool(Lua_Mob::*)(void))&Lua_Mob::IsInvisible)
|
||||
.def("IsInvisible", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsInvisible)
|
||||
.def("SetInvisible", &Lua_Mob::SetInvisible)
|
||||
.def("FindBuff", &Lua_Mob::FindBuff)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool))&Lua_Mob::FindType)
|
||||
.def("FindType", (bool(Lua_Mob::*)(int,bool,int))&Lua_Mob::FindType)
|
||||
.def("GetBuffSlotFromType", &Lua_Mob::GetBuffSlotFromType)
|
||||
.def("GetBaseRace", &Lua_Mob::GetBaseRace)
|
||||
.def("GetBaseGender", &Lua_Mob::GetBaseGender)
|
||||
.def("GetDeity", &Lua_Mob::GetDeity)
|
||||
.def("GetRace", &Lua_Mob::GetRace)
|
||||
.def("GetGender", &Lua_Mob::GetGender)
|
||||
.def("GetTexture", &Lua_Mob::GetTexture)
|
||||
.def("GetHelmTexture", &Lua_Mob::GetHelmTexture)
|
||||
.def("GetHairColor", &Lua_Mob::GetHairColor)
|
||||
.def("GetBeardColor", &Lua_Mob::GetBeardColor)
|
||||
.def("GetEyeColor1", &Lua_Mob::GetEyeColor1)
|
||||
.def("GetEyeColor2", &Lua_Mob::GetEyeColor2)
|
||||
.def("GetHairStyle", &Lua_Mob::GetHairStyle)
|
||||
.def("GetLuclinFace", &Lua_Mob::GetLuclinFace)
|
||||
.def("GetBeard", &Lua_Mob::GetBeard)
|
||||
.def("GetDrakkinHeritage", &Lua_Mob::GetDrakkinHeritage)
|
||||
.def("GetDrakkinTattoo", &Lua_Mob::GetDrakkinTattoo)
|
||||
.def("GetDrakkinDetails", &Lua_Mob::GetDrakkinDetails)
|
||||
.def("GetClass", &Lua_Mob::GetClass)
|
||||
.def("GetLevel", &Lua_Mob::GetLevel)
|
||||
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
||||
.def("GetTarget", &Lua_Mob::GetTarget)
|
||||
.def("SetTarget", &Lua_Mob::SetTarget)
|
||||
.def("GetHPRatio", &Lua_Mob::GetHPRatio)
|
||||
.def("IsWarriorClass", &Lua_Mob::IsWarriorClass)
|
||||
.def("GetHP", &Lua_Mob::GetHP)
|
||||
.def("GetMaxHP", &Lua_Mob::GetMaxHP)
|
||||
.def("GetItemHPBonuses", &Lua_Mob::GetItemHPBonuses)
|
||||
.def("GetSpellHPBonuses", &Lua_Mob::GetSpellHPBonuses)
|
||||
.def("GetWalkspeed", &Lua_Mob::GetWalkspeed)
|
||||
.def("GetRunspeed", &Lua_Mob::GetRunspeed)
|
||||
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
||||
.def("GetMaxMana", &Lua_Mob::GetMaxMana)
|
||||
.def("GetMana", &Lua_Mob::GetMana)
|
||||
.def("SetMana", &Lua_Mob::SetMana)
|
||||
.def("GetManaRatio", &Lua_Mob::GetManaRatio)
|
||||
.def("GetAC", &Lua_Mob::GetAC)
|
||||
.def("GetATK", &Lua_Mob::GetATK)
|
||||
.def("GetSTR", &Lua_Mob::GetSTR)
|
||||
.def("GetSTA", &Lua_Mob::GetSTA)
|
||||
.def("GetDEX", &Lua_Mob::GetDEX)
|
||||
.def("GetAGI", &Lua_Mob::GetAGI)
|
||||
.def("GetINT", &Lua_Mob::GetINT)
|
||||
.def("GetWIS", &Lua_Mob::GetWIS)
|
||||
.def("GetCHA", &Lua_Mob::GetCHA)
|
||||
.def("GetMR", &Lua_Mob::GetMR)
|
||||
.def("GetFR", &Lua_Mob::GetFR)
|
||||
.def("GetDR", &Lua_Mob::GetDR)
|
||||
.def("GetPR", &Lua_Mob::GetPR)
|
||||
.def("GetCR", &Lua_Mob::GetCR)
|
||||
.def("GetCorruption", &Lua_Mob::GetCorruption)
|
||||
.def("GetMaxSTR", &Lua_Mob::GetMaxSTR)
|
||||
.def("GetMaxSTA", &Lua_Mob::GetMaxSTA)
|
||||
.def("GetMaxDEX", &Lua_Mob::GetMaxDEX)
|
||||
.def("GetMaxAGI", &Lua_Mob::GetMaxAGI)
|
||||
.def("GetMaxINT", &Lua_Mob::GetMaxINT)
|
||||
.def("GetMaxWIS", &Lua_Mob::GetMaxWIS)
|
||||
.def("GetMaxCHA", &Lua_Mob::GetMaxCHA)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool,int))&Lua_Mob::ResistSpell)
|
||||
.def("ResistSpell", (double(Lua_Mob::*)(int,int,Lua_Mob,bool,int,bool))&Lua_Mob::ResistSpell)
|
||||
.def("GetSpecializeSkillValue", &Lua_Mob::GetSpecializeSkillValue)
|
||||
.def("GetNPCTypeID", &Lua_Mob::GetNPCTypeID)
|
||||
.def("IsTargeted", &Lua_Mob::IsTargeted)
|
||||
.def("GetX", &Lua_Mob::GetX)
|
||||
.def("GetY", &Lua_Mob::GetY)
|
||||
.def("GetZ", &Lua_Mob::GetZ)
|
||||
.def("GetHeading", &Lua_Mob::GetHeading)
|
||||
.def("GetWaypointX", &Lua_Mob::GetWaypointX)
|
||||
.def("GetWaypointY", &Lua_Mob::GetWaypointY)
|
||||
.def("GetWaypointZ", &Lua_Mob::GetWaypointZ)
|
||||
.def("GetWaypointH", &Lua_Mob::GetWaypointH)
|
||||
.def("GetWaypointPause", &Lua_Mob::GetWaypointPause)
|
||||
.def("GetWaypointID", &Lua_Mob::GetWaypointID)
|
||||
.def("SetCurrentWP", &Lua_Mob::SetCurrentWP)
|
||||
.def("GetSize", &Lua_Mob::GetSize)
|
||||
.def("Message", &Lua_Mob::Message)
|
||||
.def("Message_StringID", &Lua_Mob::Message_StringID)
|
||||
.def("Say", &Lua_Mob::Say)
|
||||
.def("Shout", &Lua_Mob::Shout)
|
||||
.def("Emote", &Lua_Mob::Emote)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
|
||||
.def("InterruptSpell", (void(Lua_Mob::*)(int))&Lua_Mob::InterruptSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("CastSpell", (bool(Lua_Mob::*)(int,int,int,int,int,int,int,int,int))&Lua_Mob::CastSpell)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int))&Lua_Mob::SpellFinished)
|
||||
.def("SpellFinished", (bool(Lua_Mob::*)(int,Lua_Mob,int,int,uint32,int,bool))&Lua_Mob::SpellFinished)
|
||||
.def("SpellEffect", &Lua_Mob::SpellEffect)
|
||||
.def("GetHateList", &Lua_Mob::GetHateList)
|
||||
.def("GetHateTop", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateTop)
|
||||
.def("GetHateDamageTop", (Lua_Mob(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateDamageTop)
|
||||
.def("GetHateRandom", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateRandom)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool))&Lua_Mob::AddToHateList)
|
||||
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool,bool))&Lua_Mob::AddToHateList)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::SetHate)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::SetHate)
|
||||
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::SetHate)
|
||||
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount)
|
||||
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount)
|
||||
.def("GetDamageAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetDamageAmount)
|
||||
.def("WipeHateList", (void(Lua_Mob::*)(void))&Lua_Mob::WipeHateList)
|
||||
.def("CheckAggro", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckAggro)
|
||||
.def("Stun", (void(Lua_Mob::*)(int))&Lua_Mob::Stun)
|
||||
.def("UnStun", (void(Lua_Mob::*)(void))&Lua_Mob::UnStun)
|
||||
.def("IsStunned", (bool(Lua_Mob::*)(void))&Lua_Mob::IsStunned)
|
||||
.def("Spin", (void(Lua_Mob::*)(void))&Lua_Mob::Spin)
|
||||
.def("Kill", (void(Lua_Mob::*)(void))&Lua_Mob::Kill)
|
||||
.def("CanThisClassDoubleAttack", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDoubleAttack)
|
||||
.def("CanThisClassDualWield", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDualWield)
|
||||
.def("CanThisClassRiposte", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassRiposte)
|
||||
.def("CanThisClassDodge", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassDodge)
|
||||
.def("CanThisClassParry", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassParry)
|
||||
.def("CanThisClassBlock", (bool(Lua_Mob::*)(void))&Lua_Mob::CanThisClassBlock)
|
||||
.def("SetInvul", (void(Lua_Mob::*)(bool))&Lua_Mob::SetInvul)
|
||||
.def("GetInvul", (bool(Lua_Mob::*)(void))&Lua_Mob::GetInvul)
|
||||
.def("SetExtraHaste", (void(Lua_Mob::*)(int))&Lua_Mob::SetExtraHaste)
|
||||
.def("GetHaste", (int(Lua_Mob::*)(void))&Lua_Mob::GetHaste)
|
||||
.def("GetMonkHandToHandDamage", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDamage)
|
||||
.def("GetMonkHandToHandDelay", (int(Lua_Mob::*)(void))&Lua_Mob::GetMonkHandToHandDelay)
|
||||
.def("Mesmerize", (void(Lua_Mob::*)(void))&Lua_Mob::Mesmerize)
|
||||
.def("IsMezzed", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMezzed)
|
||||
.def("IsEnraged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEnraged)
|
||||
.def("GetReverseFactionCon", (int(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetReverseFactionCon)
|
||||
.def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled)
|
||||
.def("GetAggroRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAggroRange)
|
||||
.def("GetAssistRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAssistRange)
|
||||
.def("SetPetOrder", (void(Lua_Mob::*)(int))&Lua_Mob::SetPetOrder)
|
||||
.def("GetPetOrder", (int(Lua_Mob::*)(void))&Lua_Mob::GetPetOrder)
|
||||
.def("IsRoamer", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRoamer)
|
||||
.def("IsRooted", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRooted)
|
||||
.def("IsEngaged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEngaged)
|
||||
.def("FaceTarget", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::FaceTarget)
|
||||
.def("SetHeading", (void(Lua_Mob::*)(double))&Lua_Mob::SetHeading)
|
||||
.def("CalculateHeadingToTarget", (double(Lua_Mob::*)(double,double))&Lua_Mob::CalculateHeadingToTarget)
|
||||
.def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition)
|
||||
.def("CalculateNewPosition", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition)
|
||||
.def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CalculateNewPosition2)
|
||||
.def("CalculateNewPosition2", (bool(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::CalculateNewPosition2)
|
||||
.def("CalculateDistance", (float(Lua_Mob::*)(double,double,double))&Lua_Mob::CalculateDistance)
|
||||
.def("SendTo", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendTo)
|
||||
.def("SendToFixZ", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::SendToFixZ)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("NPCSpecialAttacks", (void(Lua_Mob::*)(const char*,int,bool,bool))&Lua_Mob::NPCSpecialAttacks)
|
||||
.def("GetResist", (int(Lua_Mob::*)(int))&Lua_Mob::GetResist)
|
||||
.def("Charmed", (bool(Lua_Mob::*)(void))&Lua_Mob::Charmed)
|
||||
.def("CheckAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckAggroAmount)
|
||||
.def("CheckAggroAmount", (int(Lua_Mob::*)(int,bool))&Lua_Mob::CheckAggroAmount)
|
||||
.def("CheckHealAggroAmount", (int(Lua_Mob::*)(int))&Lua_Mob::CheckHealAggroAmount)
|
||||
.def("CheckHealAggroAmount", (int(Lua_Mob::*)(int,uint32))&Lua_Mob::CheckHealAggroAmount)
|
||||
.def("GetAA", (int(Lua_Mob::*)(int))&Lua_Mob::GetAA)
|
||||
.def("DivineAura", (bool(Lua_Mob::*)(void))&Lua_Mob::DivineAura)
|
||||
.def("SetOOCRegen", (void(Lua_Mob::*)(int))&Lua_Mob::SetOOCRegen)
|
||||
.def("GetEntityVariable", (const char*(Lua_Mob::*)(const char*))&Lua_Mob::GetEntityVariable)
|
||||
.def("SetEntityVariable", (void(Lua_Mob::*)(const char*,const char*))&Lua_Mob::SetEntityVariable)
|
||||
.def("EntityVariableExists", (bool(Lua_Mob::*)(const char*))&Lua_Mob::EntityVariableExists)
|
||||
.def("Signal", (void(Lua_Mob::*)(uint32))&Lua_Mob::Signal)
|
||||
.def("CombatRange", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CombatRange)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoSpecialAttackDamage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,int,bool))&Lua_Mob::DoSpecialAttackDamage)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoThrowingAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_Item,int,int,int))&Lua_Mob::DoThrowingAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoMeleeSkillAttackDmg", (void(Lua_Mob::*)(Lua_Mob,int,int,int,int,bool))&Lua_Mob::DoMeleeSkillAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("DoArcheryAttackDmg", (void(Lua_Mob::*)(Lua_Mob,Lua_ItemInst,Lua_ItemInst,int,int,int))&Lua_Mob::DoArcheryAttackDmg)
|
||||
.def("CheckLoS", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CheckLoS)
|
||||
.def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double))&Lua_Mob::CheckLoSToLoc)
|
||||
.def("CheckLoSToLoc", (bool(Lua_Mob::*)(double,double,double,double))&Lua_Mob::CheckLoSToLoc)
|
||||
.def("FindGroundZ", (double(Lua_Mob::*)(double,double))&Lua_Mob::FindGroundZ)
|
||||
.def("FindGroundZ", (double(Lua_Mob::*)(double,double,double))&Lua_Mob::FindGroundZ)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("ProjectileAnimation", (void(Lua_Mob::*)(Lua_Mob,int,bool,double,double,double,double))&Lua_Mob::ProjectileAnimation)
|
||||
.def("HasNPCSpecialAtk", (bool(Lua_Mob::*)(const char*))&Lua_Mob::HasNPCSpecialAtk)
|
||||
.def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32))&Lua_Mob::SendAppearanceEffect)
|
||||
.def("SendAppearanceEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,uint32,uint32,Lua_Client))&Lua_Mob::SendAppearanceEffect)
|
||||
.def("SetFlyMode", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlyMode)
|
||||
.def("SetTexture", (void(Lua_Mob::*)(int))&Lua_Mob::SetTexture)
|
||||
.def("SetRace", (void(Lua_Mob::*)(int))&Lua_Mob::SetRace)
|
||||
.def("SetGender", (void(Lua_Mob::*)(int))&Lua_Mob::SetGender)
|
||||
.def("SendIllusionPacket", (void(Lua_Mob::*)(Lua_Mob::Lua_Illusion))&Lua_Mob::SendIllusionPacket)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32))&Lua_Mob::QuestReward)
|
||||
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32,uint32))&Lua_Mob::QuestReward)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32))&Lua_Mob::CameraEffect)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client))&Lua_Mob::CameraEffect)
|
||||
.def("CameraEffect", (void(Lua_Mob::*)(uint32,uint32,Lua_Client,bool))&Lua_Mob::CameraEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32))&Lua_Mob::SendSpellEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool))&Lua_Mob::SendSpellEffect)
|
||||
.def("SendSpellEffect", (void(Lua_Mob::*)(uint32,uint32,uint32,bool,uint32,bool,Lua_Client))&Lua_Mob::SendSpellEffect)
|
||||
.def("TempName", (void(Lua_Mob::*)(void))&Lua_Mob::TempName)
|
||||
.def("TempName", (void(Lua_Mob::*)(const char*))&Lua_Mob::TempName)
|
||||
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*))&Lua_Mob::SetGlobal)
|
||||
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*,Lua_Mob))&Lua_Mob::SetGlobal)
|
||||
.def("TarGlobal", (void(Lua_Mob::*)(const char*,const char*,const char*,int,int,int))&Lua_Mob::TarGlobal)
|
||||
.def("DelGlobal", (void(Lua_Mob::*)(const char*))&Lua_Mob::DelGlobal)
|
||||
.def("SetSlotTint", (void(Lua_Mob::*)(int,int,int,int))&Lua_Mob::SetSlotTint)
|
||||
.def("WearChange", (void(Lua_Mob::*)(int,int,uint32))&Lua_Mob::WearChange)
|
||||
.def("DoKnockback", (void(Lua_Mob::*)(Lua_Mob,uint32,uint32))&Lua_Mob::DoKnockback)
|
||||
.def("RemoveNimbusEffect", (void(Lua_Mob::*)(int))&Lua_Mob::RemoveNimbusEffect)
|
||||
.def("IsRunning", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRunning)
|
||||
.def("SetRunning", (void(Lua_Mob::*)(bool))&Lua_Mob::SetRunning)
|
||||
.def("SetBodyType", (void(Lua_Mob::*)(int,bool))&Lua_Mob::SetBodyType)
|
||||
.def("SetTargetable", (void(Lua_Mob::*)(bool))&Lua_Mob::SetTargetable)
|
||||
.def("ModSkillDmgTaken", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModSkillDmgTaken)
|
||||
.def("GetModSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetModSkillDmgTaken)
|
||||
.def("GetSkillDmgTaken", (int(Lua_Mob::*)(int))&Lua_Mob::GetSkillDmgTaken)
|
||||
.def("SetAllowBeneficial", (void(Lua_Mob::*)(bool))&Lua_Mob::SetAllowBeneficial)
|
||||
.def("GetAllowBeneficial", (bool(Lua_Mob::*)(void))&Lua_Mob::GetAllowBeneficial)
|
||||
.def("IsBeneficialAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsBeneficialAllowed)
|
||||
.def("ModVulnerability", (void(Lua_Mob::*)(int,int))&Lua_Mob::ModVulnerability)
|
||||
.def("GetModVulnerability", (int(Lua_Mob::*)(int))&Lua_Mob::GetModVulnerability)
|
||||
.def("SetDisableMelee", (void(Lua_Mob::*)(bool))&Lua_Mob::SetDisableMelee)
|
||||
.def("IsMeleeDisabled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsMeleeDisabled)
|
||||
.def("SetFlurryChance", (void(Lua_Mob::*)(int))&Lua_Mob::SetFlurryChance)
|
||||
.def("GetFlurryChance", (int(Lua_Mob::*)(void))&Lua_Mob::GetFlurryChance),
|
||||
|
||||
luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||
.def(luabind::constructor<>()),
|
||||
|
||||
luabind::class_<Lua_NPC, Lua_Mob>("NPC")
|
||||
.def(luabind::constructor<>()),
|
||||
|
||||
luabind::class_<Lua_ItemInst>("ItemInst")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_ItemInst::Null)
|
||||
.property("valid", &Lua_ItemInst::Valid),
|
||||
|
||||
luabind::class_<Lua_Item>("Item")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Item::Null)
|
||||
.property("valid", &Lua_Item::Valid),
|
||||
|
||||
luabind::class_<Lua_Spell>("Spell")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Spell::Null)
|
||||
.property("valid", &Lua_Spell::Valid),
|
||||
lua_register_general(),
|
||||
lua_register_events(),
|
||||
lua_register_entity(),
|
||||
lua_register_mob(),
|
||||
lua_register_npc(),
|
||||
lua_register_client(),
|
||||
lua_register_iteminst(),
|
||||
lua_register_item(),
|
||||
lua_register_spell(),
|
||||
|
||||
luabind::class_<Lua_HateEntry>("HateEntry")
|
||||
.property("null", &Lua_HateEntry::Null)
|
||||
@ -1019,7 +811,118 @@ void LuaParser::MapFunctions(lua_State *L) {
|
||||
];
|
||||
|
||||
} catch(std::exception &ex) {
|
||||
printf("Error: %s\n", ex.what());
|
||||
std::string error = ex.what();
|
||||
AddError(error);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaParser::GetErrors(std::list<std::string> &err) {
|
||||
err.insert(err.end(), errors_.begin(), errors_.end());
|
||||
}
|
||||
|
||||
void LuaParser::AddError(std::string error) {
|
||||
errors_.push_back(error);
|
||||
if(errors_.size() > 30) {
|
||||
errors_.pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
void LuaParser::DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
if(!npc)
|
||||
return;
|
||||
|
||||
std::stringstream package_name;
|
||||
package_name << "npc_" << npc->GetNPCTypeID();
|
||||
|
||||
auto iter = lua_encounter_events_registered.find(package_name.str());
|
||||
if(iter == lua_encounter_events_registered.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto riter = iter->second.begin();
|
||||
while(riter != iter->second.end()) {
|
||||
if(riter->event_id == evt) {
|
||||
std::string package_name = "encounter_" + riter->encounter_name;
|
||||
_EventNPC(package_name, evt, npc, init, data, extra_data, &riter->lua_reference);
|
||||
}
|
||||
++riter;
|
||||
}
|
||||
}
|
||||
|
||||
void LuaParser::DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
std::string package_name = "player";
|
||||
|
||||
auto iter = lua_encounter_events_registered.find(package_name);
|
||||
if(iter == lua_encounter_events_registered.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto riter = iter->second.begin();
|
||||
while(riter != iter->second.end()) {
|
||||
if(riter->event_id == evt) {
|
||||
std::string package_name = "encounter_" + riter->encounter_name;
|
||||
_EventPlayer(package_name, evt, client, data, extra_data, &riter->lua_reference);
|
||||
}
|
||||
++riter;
|
||||
}
|
||||
}
|
||||
|
||||
void LuaParser::DispatchEventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) {
|
||||
if(!item)
|
||||
return;
|
||||
|
||||
std::stringstream package_name;
|
||||
package_name << "item_";
|
||||
|
||||
std::stringstream item_name;
|
||||
const Item_Struct* itm = item->GetItem();
|
||||
if(evt == EVENT_SCALE_CALC || evt == EVENT_ITEM_ENTER_ZONE)
|
||||
{
|
||||
item_name << itm->CharmFile;
|
||||
}
|
||||
else if(evt == EVENT_ITEM_CLICK || evt == EVENT_ITEM_CLICK_CAST)
|
||||
{
|
||||
item_name << "script_";
|
||||
item_name << itm->ScriptFileID;
|
||||
}
|
||||
else
|
||||
{
|
||||
item_name << "item_";
|
||||
item_name << itm->ID;
|
||||
}
|
||||
package_name << item_name;
|
||||
|
||||
auto iter = lua_encounter_events_registered.find(package_name.str());
|
||||
if(iter == lua_encounter_events_registered.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto riter = iter->second.begin();
|
||||
while(riter != iter->second.end()) {
|
||||
if(riter->event_id == evt) {
|
||||
std::string package_name = "encounter_" + riter->encounter_name;
|
||||
_EventItem(package_name, evt, client, item, objid, extra_data, &riter->lua_reference);
|
||||
}
|
||||
++riter;
|
||||
}
|
||||
}
|
||||
|
||||
void LuaParser::DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) {
|
||||
std::stringstream package_name;
|
||||
package_name << "spell_" << spell_id;
|
||||
|
||||
auto iter = lua_encounter_events_registered.find(package_name.str());
|
||||
if(iter == lua_encounter_events_registered.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto riter = iter->second.begin();
|
||||
while(riter != iter->second.end()) {
|
||||
if(riter->event_id == evt) {
|
||||
std::string package_name = "encounter_" + riter->encounter_name;
|
||||
_EventSpell(package_name, evt, npc, client, spell_id, extra_data, &riter->lua_reference);
|
||||
}
|
||||
++riter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include "QuestParserCollection.h"
|
||||
#include "QuestInterface.h"
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
struct lua_State;
|
||||
@ -14,6 +15,11 @@ class NPC;
|
||||
|
||||
#include "lua_parser_events.h"
|
||||
|
||||
struct lua_registered_event;
|
||||
namespace luabind {
|
||||
class object;
|
||||
}
|
||||
|
||||
class LuaParser : public QuestInterface {
|
||||
public:
|
||||
LuaParser();
|
||||
@ -25,6 +31,7 @@ public:
|
||||
virtual int EventGlobalPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data);
|
||||
virtual int EventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data);
|
||||
virtual int EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data);
|
||||
virtual int EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data);
|
||||
|
||||
virtual bool HasQuestSub(uint32 npc_id, const char *subname);
|
||||
virtual bool HasGlobalQuestSub(const char *subname);
|
||||
@ -32,6 +39,7 @@ public:
|
||||
virtual bool GlobalPlayerHasQuestSub(const char *subname);
|
||||
virtual bool SpellHasQuestSub(uint32 spell_id, const char *subname);
|
||||
virtual bool ItemHasQuestSub(ItemInst *itm, const char *subname);
|
||||
virtual bool EncounterHasQuestSub(std::string encounter_name, const char *subname);
|
||||
|
||||
virtual void LoadNPCScript(std::string filename, int npc_id);
|
||||
virtual void LoadGlobalNPCScript(std::string filename);
|
||||
@ -39,24 +47,39 @@ public:
|
||||
virtual void LoadGlobalPlayerScript(std::string filename);
|
||||
virtual void LoadItemScript(std::string filename, std::string item_script);
|
||||
virtual void LoadSpellScript(std::string filename, uint32 spell_id);
|
||||
virtual void LoadEncounterScript(std::string filename, std::string encounter_name);
|
||||
|
||||
virtual void AddVar(std::string name, std::string val);
|
||||
virtual std::string GetVar(std::string name);
|
||||
virtual void ReloadQuests();
|
||||
virtual uint32 GetIdentifier() { return 0xb0712acc; }
|
||||
virtual void GetErrors(std::list<std::string> &err);
|
||||
|
||||
virtual void DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data);
|
||||
virtual void DispatchEventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data);
|
||||
virtual void DispatchEventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data);
|
||||
virtual void DispatchEventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data);
|
||||
|
||||
private:
|
||||
int _EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data);
|
||||
int _EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data);
|
||||
int _EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data);
|
||||
int _EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data);
|
||||
int _EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
luabind::object *l_func = nullptr);
|
||||
int _EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data,
|
||||
luabind::object *l_func = nullptr);
|
||||
int _EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data,
|
||||
luabind::object *l_func = nullptr);
|
||||
int _EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
|
||||
luabind::object *l_func = nullptr);
|
||||
int _EventEncounter(std::string package_name, QuestEventID evt, std::string encounter_name, uint32 extra_data);
|
||||
|
||||
void LoadScript(std::string filename, std::string package_name);
|
||||
bool HasFunction(std::string function, std::string package_name);
|
||||
void ClearStates();
|
||||
void MapFunctions(lua_State *L);
|
||||
void AddError(std::string error);
|
||||
|
||||
std::map<std::string, std::string> vars_;
|
||||
std::map<std::string, bool> loaded_;
|
||||
std::list<std::string> errors_;
|
||||
lua_State *L;
|
||||
|
||||
NPCArgumentHandler NPCArgumentDispatch[_LargestEventID];
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
//NPC
|
||||
void handle_npc_event_say(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
npc->DoQuestPause(init);
|
||||
|
||||
Lua_Client l_client(reinterpret_cast<Client*>(init));
|
||||
luabind::object l_client_o = luabind::object(L, l_client);
|
||||
l_client_o.push(L);
|
||||
|
||||
@ -3,4 +3,14 @@
|
||||
#include "../common/spdat.h"
|
||||
#include "lua_spell.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
luabind::scope lua_register_spell() {
|
||||
return luabind::class_<Lua_Spell>("Spell")
|
||||
.def(luabind::constructor<>())
|
||||
.property("null", &Lua_Spell::Null)
|
||||
.property("valid", &Lua_Spell::Valid);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
|
||||
struct SPDat_Spell_Struct;
|
||||
|
||||
namespace luabind {
|
||||
struct scope;
|
||||
}
|
||||
|
||||
luabind::scope lua_register_spell();
|
||||
|
||||
class Lua_Spell : public Lua_Ptr<const void>
|
||||
{
|
||||
typedef const SPDat_Spell_Struct NativeType;
|
||||
|
||||
@ -2471,3 +2471,12 @@ uint32 NPC::GetSpawnKillCount()
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void NPC::DoQuestPause(Mob *other) {
|
||||
if(IsMoving() && !IsOnHatelist(other))
|
||||
PauseWandering(RuleI(NPC, SayPauseTimeInSec));
|
||||
|
||||
if(!IsMoving())
|
||||
FaceTarget(other);
|
||||
|
||||
}
|
||||
@ -342,6 +342,7 @@ public:
|
||||
NPC_Emote_Struct* GetNPCEmote(uint16 emoteid, uint8 event_);
|
||||
void DoNPCEmote(uint8 event_, uint16 emoteid);
|
||||
bool CanTalk();
|
||||
void DoQuestPause(Mob *other);
|
||||
|
||||
inline void SetSpellScale(float amt) { spellscale = amt; }
|
||||
inline float GetSpellScale() { return spellscale; }
|
||||
|
||||
@ -1522,7 +1522,7 @@ void QuestManager::set_proximity(float minx, float maxx, float miny, float maxy,
|
||||
owner->CastToNPC()->proximity->min_z = minz;
|
||||
owner->CastToNPC()->proximity->max_z = maxz;
|
||||
|
||||
owner->CastToNPC()->proximity->say = parse->HasQuestSub(owner->CastToNPC()->GetNPCTypeID(),"EVENT_PROXIMITY_SAY");
|
||||
owner->CastToNPC()->proximity->say = parse->HasQuestSub(owner->CastToNPC()->GetNPCTypeID(), "EVENT_PROXIMITY_SAY");
|
||||
|
||||
if(owner->CastToNPC()->proximity->say)
|
||||
HaveProximitySays = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user