mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +00:00
Change space indentation to tabs
This commit is contained in:
+51
-51
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
//extends the parser to include perl
|
||||
@@ -72,7 +72,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_PROXIMITY_SAY",
|
||||
"EVENT_CAST",
|
||||
"EVENT_SCALE_CALC",
|
||||
"EVENT_ITEM_ENTERZONE",
|
||||
"EVENT_ITEM_ENTERZONE",
|
||||
"EVENT_TARGET_CHANGE",
|
||||
"EVENT_HATE_LIST",
|
||||
"EVENT_SPELL_EFFECT_CLIENT",
|
||||
@@ -105,7 +105,7 @@ PerlembParser::PerlembParser(void) : Parser()
|
||||
{
|
||||
perl = nullptr;
|
||||
eventQueueProcessing = false;
|
||||
globalPlayerQuestLoaded = pQuestReadyToLoad;
|
||||
globalPlayerQuestLoaded = pQuestReadyToLoad;
|
||||
globalNPCQuestLoaded = nQuestReadyToLoad;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
}
|
||||
|
||||
bool isPlayerQuest = false;
|
||||
bool isGlobalPlayerQuest = false;
|
||||
bool isGlobalPlayerQuest = false;
|
||||
bool isGlobalNPC = false;
|
||||
bool isItemQuest = false;
|
||||
bool isSpellQuest = false;
|
||||
@@ -260,12 +260,12 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
{
|
||||
if(!npcmob && mob) {
|
||||
if(!iteminst) {
|
||||
if(global) {
|
||||
isGlobalPlayerQuest = true;
|
||||
} else {
|
||||
isPlayerQuest = true;
|
||||
}
|
||||
}
|
||||
if(global) {
|
||||
isGlobalPlayerQuest = true;
|
||||
} else {
|
||||
isPlayerQuest = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
isItemQuest = true;
|
||||
}
|
||||
@@ -324,14 +324,14 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
LoadPlayerScript(zone->GetShortName());
|
||||
}
|
||||
}
|
||||
else if(isGlobalPlayerQuest) {
|
||||
packagename = "global_player";
|
||||
else if(isGlobalPlayerQuest) {
|
||||
packagename = "global_player";
|
||||
|
||||
if(!isloaded(packagename.c_str()))
|
||||
{
|
||||
LoadGlobalPlayerScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
packagename = "spell_effect_";
|
||||
@@ -350,16 +350,16 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
}
|
||||
|
||||
int charid = 0;
|
||||
if (mob && mob->IsClient()) { // some events like waypoint and spawn don't have a player involved
|
||||
if (mob && mob->IsClient()) { // some events like waypoint and spawn don't have a player involved
|
||||
charid = mob->CastToClient()->CharacterID();
|
||||
} else {
|
||||
if(npcmob)
|
||||
{
|
||||
charid = -npcmob->GetNPCTypeID(); // make char id negative npc id as a fudge
|
||||
charid = -npcmob->GetNPCTypeID(); // make char id negative npc id as a fudge
|
||||
}
|
||||
else if(mob && mob->IsNPC())
|
||||
{
|
||||
charid = -mob->CastToNPC()->GetNPCTypeID(); // make char id negative npc id as a fudge
|
||||
charid = -mob->CastToNPC()->GetNPCTypeID(); // make char id negative npc id as a fudge
|
||||
}
|
||||
}
|
||||
ExportVar(packagename.c_str(), "charid", charid);
|
||||
@@ -593,7 +593,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
switch (event) {
|
||||
case EVENT_SAY: {
|
||||
if (npcmob && npcmob->GetAppearance() != eaDead)
|
||||
npcmob->FaceTarget(mob);
|
||||
npcmob->FaceTarget(mob);
|
||||
ExportVar(packagename.c_str(), "data", objid);
|
||||
ExportVar(packagename.c_str(), "text", data);
|
||||
ExportVar(packagename.c_str(), "langid", extradata);
|
||||
@@ -601,7 +601,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
}
|
||||
case EVENT_ITEM: {
|
||||
if (npcmob->GetAppearance() != eaDead)
|
||||
npcmob->FaceTarget(mob);
|
||||
npcmob->FaceTarget(mob);
|
||||
//this is such a hack... why aren't these just set directly..
|
||||
ExportVar(packagename.c_str(), "item1", GetVar("item1", objid).c_str());
|
||||
ExportVar(packagename.c_str(), "item2", GetVar("item2", objid).c_str());
|
||||
@@ -737,7 +737,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
break;
|
||||
}
|
||||
case EVENT_SCALE_CALC:
|
||||
case EVENT_ITEM_ENTERZONE: {
|
||||
case EVENT_ITEM_ENTERZONE: {
|
||||
ExportVar(packagename.c_str(), "itemid", objid);
|
||||
ExportVar(packagename.c_str(), "itemname", iteminst->GetItem()->Name);
|
||||
break;
|
||||
@@ -842,11 +842,11 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
}
|
||||
else if(isSpellQuest)
|
||||
{
|
||||
if(mob) {
|
||||
SendCommands(packagename.c_str(), sub_name, 0, mob, mob, nullptr);
|
||||
} else {
|
||||
SendCommands(packagename.c_str(), sub_name, 0, npcmob, mob, nullptr);
|
||||
}
|
||||
if(mob) {
|
||||
SendCommands(packagename.c_str(), sub_name, 0, mob, mob, nullptr);
|
||||
} else {
|
||||
SendCommands(packagename.c_str(), sub_name, 0, npcmob, mob, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SendCommands(packagename.c_str(), sub_name, objid, npcmob, mob, nullptr);
|
||||
@@ -857,27 +857,27 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d
|
||||
}
|
||||
|
||||
void PerlembParser::EventGlobalNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data, true);
|
||||
EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data, true);
|
||||
}
|
||||
|
||||
void PerlembParser::EventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) {
|
||||
EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data);
|
||||
EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data);
|
||||
}
|
||||
|
||||
void PerlembParser::EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data);
|
||||
EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data);
|
||||
}
|
||||
|
||||
void PerlembParser::EventGlobalPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) {
|
||||
EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data, true);
|
||||
EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data, true);
|
||||
}
|
||||
|
||||
void PerlembParser::EventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) {
|
||||
EventCommon(evt, objid, nullptr, nullptr, item, client, extra_data);
|
||||
EventCommon(evt, objid, nullptr, nullptr, item, client, extra_data);
|
||||
}
|
||||
|
||||
void PerlembParser::EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) {
|
||||
EventCommon(evt, 0, itoa(spell_id), npc, nullptr, client, extra_data);
|
||||
EventCommon(evt, 0, itoa(spell_id), npc, nullptr, client, extra_data);
|
||||
}
|
||||
|
||||
void PerlembParser::ReloadQuests(bool with_timers) {
|
||||
@@ -915,7 +915,7 @@ void PerlembParser::ReloadQuests(bool with_timers) {
|
||||
hasQuests.clear();
|
||||
playerQuestLoaded.clear();
|
||||
globalPlayerQuestLoaded = pQuestReadyToLoad;
|
||||
globalNPCQuestLoaded = nQuestReadyToLoad;
|
||||
globalNPCQuestLoaded = nQuestReadyToLoad;
|
||||
itemQuestLoaded.clear();
|
||||
spellQuestLoaded.clear();
|
||||
}
|
||||
@@ -1142,8 +1142,8 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater)
|
||||
//LogFile->write(EQEMuLog::Debug, " finally settling on '%s'", filename.c_str());
|
||||
// LogFile->write(EQEMuLog::Status, "Looking for quest file: '%s'", filename.c_str());
|
||||
|
||||
// todo: decide whether or not to delete the package to allow for script refreshes w/o restarting the server
|
||||
// remember to guard against deleting the default package, on a similar note... consider deleting packages upon zone change
|
||||
// todo: decide whether or not to delete the package to allow for script refreshes w/o restarting the server
|
||||
// remember to guard against deleting the default package, on a similar note... consider deleting packages upon zone change
|
||||
// try { perl->eval(std::string("delete_package(\"").append(packagename).append("\");").c_str()); }
|
||||
// catch(...) {/*perl balked at us trynig to delete a non-existant package... no big deal.*/}
|
||||
|
||||
@@ -1192,7 +1192,7 @@ int PerlembParser::LoadGlobalNPCScript()
|
||||
|
||||
string filename = "quests/";
|
||||
filename += QUEST_TEMPLATES_DIRECTORY;
|
||||
filename += "/global_npc.pl";
|
||||
filename += "/global_npc.pl";
|
||||
string packagename = "global_npc";
|
||||
|
||||
try {
|
||||
@@ -1225,8 +1225,8 @@ int PerlembParser::LoadPlayerScript(const char *zone_name)
|
||||
string filename= "quests/";
|
||||
filename += zone_name;
|
||||
filename += "/player_v";
|
||||
filename += itoa(zone->GetInstanceVersion());
|
||||
filename += ".pl";
|
||||
filename += itoa(zone->GetInstanceVersion());
|
||||
filename += ".pl";
|
||||
string packagename = "player";
|
||||
packagename += "_";
|
||||
packagename += zone_name;
|
||||
@@ -1239,11 +1239,11 @@ int PerlembParser::LoadPlayerScript(const char *zone_name)
|
||||
LogFile->write(EQEMuLog::Quest, "WARNING: error compiling quest file %s: %s", filename.c_str(), err);
|
||||
}
|
||||
|
||||
if(!isloaded(packagename.c_str()))
|
||||
if(!isloaded(packagename.c_str()))
|
||||
{
|
||||
filename= "quests/";
|
||||
filename += zone_name;
|
||||
filename += "/player.pl";
|
||||
filename += zone_name;
|
||||
filename += "/player.pl";
|
||||
try {
|
||||
perl->eval_file(packagename.c_str(), filename.c_str());
|
||||
}
|
||||
@@ -1253,7 +1253,7 @@ int PerlembParser::LoadPlayerScript(const char *zone_name)
|
||||
}
|
||||
}
|
||||
|
||||
//todo: change this to just read eval_file's %cache - duh!
|
||||
//todo: change this to just read eval_file's %cache - duh!
|
||||
if(!isloaded(packagename.c_str()))
|
||||
{
|
||||
filename = "quests/";
|
||||
@@ -1296,7 +1296,7 @@ int PerlembParser::LoadGlobalPlayerScript()
|
||||
|
||||
string filename = "quests/";
|
||||
filename += QUEST_TEMPLATES_DIRECTORY;
|
||||
filename += "/global_player.pl";
|
||||
filename += "/global_player.pl";
|
||||
string packagename = "global_player";
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user