diff options
author | Blaymoira <none@none> | 2009-01-05 21:12:35 +0100 |
---|---|---|
committer | Blaymoira <none@none> | 2009-01-05 21:12:35 +0100 |
commit | 7addfe0b00c0037d9aa5aedb9b66765f22526657 (patch) | |
tree | 226536e8adc9ea1e323e56a9387bf54c3f2a6146 /src/game/Level2.cpp | |
parent | 7921e2fd6bb6e398c25dc171f9d99dc5048336f3 (diff) |
*New commands: .gobject addtemp/.npc addtemp - by XTZGZoReX
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r-- | src/game/Level2.cpp | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 6601e52d270..0258954d983 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -3946,9 +3946,64 @@ bool ChatHandler::HandleActivateObjectCommand(const char *args) // Activate obj->SetLootState(GO_READY); - obj->UseDoorOrButton(10000); + obj->UseDoorOrButton(10000); PSendSysMessage("Object activated!"); return true; } + +// add creature, temp only +bool ChatHandler::HandleTempAddSpwCommand(const char* args) +{ + if(!*args) + return false; + char* charID = strtok((char*)args, " "); + if (!charID) + return false; + + Player *chr = m_session->GetPlayer(); + + float x = chr->GetPositionX(); + float y = chr->GetPositionY(); + float z = chr->GetPositionZ(); + float ang = chr->GetOrientation(); + + uint32 id = atoi(charID); + + chr->SummonCreature(id,x,y,z,ang,TEMPSUMMON_CORPSE_DESPAWN,120); + + return true; +} + +// add go, temp only +bool ChatHandler::HandleTempGameObjectCommand(const char* args) +{ + if(!*args) + return false; + char* charID = strtok((char*)args, " "); + if (!charID) + return false; + + Player *chr = m_session->GetPlayer(); + + char* spawntime = strtok(NULL, " "); + uint32 spawntm; + + if( spawntime ) + spawntm = atoi((char*)spawntime); + + float x = chr->GetPositionX(); + float y = chr->GetPositionY(); + float z = chr->GetPositionZ(); + float ang = chr->GetOrientation(); + + float rot2 = sin(ang/2); + float rot3 = cos(ang/2); + + uint32 id = atoi(charID); + + chr->SummonGameObject(id,x,y,z,ang,0,0,rot2,rot3,spawntm); + + return true; +} |