Skip to content

Commit

Permalink
FIXED: Chat - Now properly changes with phase
Browse files Browse the repository at this point in the history
FIXED: Non-targeted spells (targeted ones already worked properly)
ADDED: .character phase command to be a get/set command at the same time, depending on parameters (you can view the phase of someone without parameters, with parameters you can set it)
ADDED: .npc phase <phase> <save> - save represents an optional 1 to save the phase of the npc to the database.
ADDED: .go phase <phase> <save> - remember without the <>...
The spawn commands will set the spawned object's phase to match the player's phase; if it is not the desired outcome, then you can use the above 3 commands. The various info commands should list the phase value too.

FIXED: Mana bar/power bar (just stumbled upon it while testing things, so fixed it along the way)
FIXED: Combat pets now properly follow phase changes.
MODIFIED: Server's packet logging to include the account id, so you can easily tell now which packet came/went from/to who.
FIXED: Various small warnings about uninitialized variables and 0 vs NULL differences.

Please see my thread here: http://arcemu.org/forums/index.php?showtopic=17179 - for more information on phasing!
  • Loading branch information
Vlack authored and Vlack committed Aug 13, 2009
1 parent 0fb3446 commit bee9f12
Show file tree
Hide file tree
Showing 35 changed files with 411 additions and 110 deletions.
1 change: 1 addition & 0 deletions sql/character_updates/2828_characters_phase.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `characters` ADD COLUMN `phase` int(10) UNSIGNED DEFAULT '1' NOT NULL after `glyphs`;
2 changes: 1 addition & 1 deletion sql/world_updates/2682_creature_spawns.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
alter table `creature_spawns` add column `CanFly` smallint(3) DEFAULT '0' NOT NULL;
alter table `creature_spawns` add column `CanFly` smallint(3) DEFAULT '0' NOT NULL after `slot3item`;
16 changes: 16 additions & 0 deletions sql/world_updates/2828_spawns_phase.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ALTER TABLE `creature_spawns` ADD COLUMN `phase` int(10) UNSIGNED DEFAULT '1' NOT NULL after `CanFly`;

ALTER TABLE `gameobject_spawns` ADD COLUMN `phase` int(10) UNSIGNED DEFAULT '1' NOT NULL after `stateNpcLink`;

ALTER TABLE `creature_staticspawns` ADD COLUMN `channel_spell` int(30) DEFAULT '0' NOT NULL after `npc_respawn_link`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `channel_target_sqlid` int(30) DEFAULT '0' NOT NULL after `channel_spell`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `channel_target_sqlid_creature` int(30) DEFAULT '0' NOT NULL after `channel_target_sqlid`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `standstate` int(10) DEFAULT '0' NOT NULL after `channel_target_sqlid_creature`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `mountdisplayid` int(10) UNSIGNED DEFAULT '0' NOT NULL after `standstate`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `slot1item` int(10) UNSIGNED DEFAULT '0' NOT NULL after `mountdisplayid`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `slot2item` int(10) UNSIGNED DEFAULT '0' NOT NULL after `slot1item`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `slot3item` int(10) UNSIGNED DEFAULT '0' NOT NULL after `slot2item`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `CanFly` smallint(3) DEFAULT '0' NOT NULL after `slot3item`;
ALTER TABLE `creature_staticspawns` ADD COLUMN `phase` int(10) UNSIGNED DEFAULT '1' NOT NULL after `CanFly`;

ALTER TABLE `gameobject_staticspawns` ADD COLUMN `phase` int(10) UNSIGNED DEFAULT '1' NOT NULL after `respawnNpcLink`;
2 changes: 1 addition & 1 deletion src/arcemu-shared/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class WorldLog : public Singleton<WorldLog>
WorldLog();
~WorldLog();

void LogPacket(uint32 len, uint16 opcode, const uint8* data, uint8 direction);
void LogPacket(uint32 len, uint16 opcode, const uint8* data, uint8 direction, uint32 accountid=0);
void Enable();
void Disable();
private:
Expand Down
37 changes: 28 additions & 9 deletions src/arcemu-world/AIInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ void AIInterface::_UpdateTargets()
{
i2 = i++;
if((*i2) == NULL || (*i2)->event_GetCurrentInstanceId() != m_Unit->event_GetCurrentInstanceId() ||
!(*i2)->isAlive() || m_Unit->GetDistanceSq((*i2)) >= 2500.0f || !(*i2)->CombatStatus.IsInCombat() )
!(*i2)->isAlive() || m_Unit->GetDistanceSq((*i2)) >= 2500.0f || !(*i2)->CombatStatus.IsInCombat() || !((*i2)->m_phase & m_Unit->m_phase) )
{
m_assistTargets.erase( i2 );
}
Expand Down Expand Up @@ -963,7 +963,7 @@ void AIInterface::_UpdateTargets()
}
}

if( ai_t->event_GetCurrentInstanceId() != m_Unit->event_GetCurrentInstanceId() || !ai_t->isAlive() || (!instance && m_Unit->GetDistanceSq(ai_t) >= 6400.0f)) {
if( ai_t->event_GetCurrentInstanceId() != m_Unit->event_GetCurrentInstanceId() || !ai_t->isAlive() || (!instance && m_Unit->GetDistanceSq(ai_t) >= 6400.0f || !(ai_t->m_phase & m_Unit->m_phase))) {
m_aiTargets.erase( it2 );
}
}
Expand Down Expand Up @@ -1038,7 +1038,7 @@ void AIInterface::_UpdateCombat(uint32 p_time)
&& m_AIState != STATE_EVADE
&& m_AIState != STATE_SCRIPTMOVE
&& !m_is_in_instance
&& (m_outOfCombatRange && m_Unit->GetDistanceSq(m_returnX,m_returnY,m_returnZ) > m_outOfCombatRange) )
&& (m_outOfCombatRange && m_Unit->GetDistanceSq(m_returnX,m_returnY,m_returnZ) > m_outOfCombatRange) )
{
HandleEvent( EVENT_LEAVECOMBAT, m_Unit, 0 );
}
Expand All @@ -1054,6 +1054,16 @@ void AIInterface::_UpdateCombat(uint32 p_time)
{
HandleEvent( EVENT_LEAVECOMBAT, m_Unit, 0 );
}
} else if( GetNextTarget() && !(GetNextTarget()->m_phase & m_Unit->m_phase) ) // the target or we changed phase, stop attacking
{
if( m_is_in_instance )
SetNextTarget( FindTarget() );
else
SetNextTarget( GetMostHated() );
if( GetNextTarget() == NULL )
{
HandleEvent( EVENT_LEAVECOMBAT, m_Unit, 0 );
}
}

#ifdef HACKY_SERVER_CLIENT_POS_SYNC
Expand Down Expand Up @@ -1656,6 +1666,9 @@ bool AIInterface::UnsafeCanOwnerAttackUnit(Unit *pUnit)
if( pUnit->bInvincible )
return false;

if( !(pUnit->m_phase & m_Unit->m_phase) ) //Not in the same phase
return false;

//do not agro units that are faking death. Should this be based on chance ?
if( pUnit->HasFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_FEIGN_DEATH ) )
return false;
Expand Down Expand Up @@ -1741,6 +1754,8 @@ Unit* AIInterface::FindTarget()
continue;
if( !tmpPlr->HasFlag( PLAYER_FLAGS, 0x100) )//PvP Guard Attackable.
continue;
if( !(tmpPlr->m_phase & m_Unit->m_phase) ) //Not in the same phase, skip this target
continue;

dist = m_Unit->GetDistanceSq(tmpPlr);

Expand Down Expand Up @@ -1822,12 +1837,13 @@ Unit* AIInterface::FindTarget()

pUnit = static_cast< Unit* >( (*itr) );

// if the target is not attackable we are not going to attack it and find a new target, if possible
if( pUnit->IsCreature() ){
Creature *pCreature = static_cast<Creature*>( pUnit );
if( pCreature->m_spawn && !pCreature->isattackable( pCreature->m_spawn ) )
continue;
}
// if the target is not attackable we are not going to attack it and find a new target, if possible
if( pUnit->IsCreature() )
{
Creature *pCreature = static_cast<Creature*>( pUnit );
if( pCreature->m_spawn && !pCreature->isattackable( pCreature->m_spawn ) )
continue;
}

if( UnsafeCanOwnerAttackUnit( pUnit ) == false )
continue;
Expand Down Expand Up @@ -1979,6 +1995,9 @@ bool AIInterface::FindFriends(float dist)
continue;
}

if( !(pUnit->m_phase & m_Unit->m_phase) ) //We can't help a friendly unit if it is not in our phase
continue;

if( isCombatSupport( m_Unit, pUnit ) && ( pUnit->GetAIInterface()->getAIState() == STATE_IDLE || pUnit->GetAIInterface()->getAIState() == STATE_SCRIPTIDLE ) )//Not sure
{
if( m_Unit->GetDistanceSq(pUnit) < dist)
Expand Down
32 changes: 16 additions & 16 deletions src/arcemu-world/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,17 @@ void WorldSession::FullLogin(Player * plr)
movement_packet[0] = m_MoverWoWGuid.GetNewGuidMask();
memcpy(&movement_packet[1], m_MoverWoWGuid.GetNewGuid(), m_MoverWoWGuid.GetNewGuidLen());

//VLack: send dungeon difficulty and MOTD, as seen in the 3.1.1 packet dump
WorldPacket datadd(MSG_SET_DUNGEON_DIFFICULTY, 20);
datadd << plr->iInstanceType;
datadd << uint32(0x01);
datadd << uint32(0x00);
SendPacket(&datadd);

WorldPacket datamo(SMSG_MOTD, 50);
datamo << uint32(0x04);
datamo << sWorld.GetMotd();
SendPacket(&datamo);
//VLack: send dungeon difficulty and MOTD, as seen in the 3.1.1 packet dump
WorldPacket datadd(MSG_SET_DUNGEON_DIFFICULTY, 20);
datadd << plr->iInstanceType;
datadd << uint32(0x01);
datadd << uint32(0x00);
SendPacket(&datadd);

WorldPacket datamo(SMSG_MOTD, 100);
datamo << uint32(0x04);
datamo << sWorld.GetMotd();
SendPacket(&datamo);

/* world preload */
packetSMSG_LOGIN_VERIFY_WORLD vwpck;
Expand Down Expand Up @@ -764,10 +764,10 @@ void WorldSession::FullLogin(Player * plr)
#endif

//VLack: Mangos sends this packet on 3.1:
WorldPacket dataldm(SMSG_LEARNED_DANCE_MOVES, 4+4);
dataldm << uint32(0);
dataldm << uint32(0);
SendPacket(&dataldm);
WorldPacket dataldm(SMSG_LEARNED_DANCE_MOVES, 4+4);
dataldm << uint32(0);
dataldm << uint32(0);
SendPacket(&dataldm);

plr->UpdateAttackSpeed();
/*if(plr->getLevel()>PLAYER_LEVEL_CAP_70)
Expand All @@ -794,7 +794,7 @@ void WorldSession::FullLogin(Player * plr)
info->guildRank = NULL;
info->guildMember = NULL;
info->m_Group = NULL;
info->subGroup = NULL;
info->subGroup = 0;
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
Expand Down
13 changes: 8 additions & 5 deletions src/arcemu-world/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ void CommandTableStorage::Init()
{ "testlos", 'd', &ChatHandler::HandleCollisionTestLOS, "tests los", NULL, 0, 0, 0 },
{ "testindoor", 'd', &ChatHandler::HandleCollisionTestIndoor, "tests indoor", NULL, 0, 0, 0 },
{ "getheight", 'd', &ChatHandler::HandleCollisionGetHeight, "Gets height", NULL, 0, 0, 0 },
{ "deathstate", 'd', &ChatHandler::HandleGetDeathState, "returns current deathstate for target", NULL, 0, 0, 0 },
{ "deathstate", 'd', &ChatHandler::HandleGetDeathState, "returns current deathstate for target", NULL, 0, 0, 0 },
{ "getpos", 'd', &ChatHandler::HandleGetPosCommand, "", NULL, 0, 0, 0 },
{ "sendfailed", 'd', &ChatHandler::HandleSendFailed, "", NULL, 0, 0, 0 },
{ "playmovie", 'd', &ChatHandler::HandlePlayMovie, "Triggers a movie for a player", NULL, 0, 0, 0 },
{ "sendfailed", 'd', &ChatHandler::HandleSendFailed, "", NULL, 0, 0, 0 },
{ "playmovie", 'd', &ChatHandler::HandlePlayMovie, "Triggers a movie for a player", NULL, 0, 0, 0 },
{ NULL, '0', NULL, "", NULL, 0, 0, 0 }
};
dupe_command_table(debugCommandTable, _debugCommandTable);
Expand Down Expand Up @@ -372,6 +372,7 @@ void CommandTableStorage::Init()
{ "select", 'o', &ChatHandler::HandleGOSelect, "Selects the nearest GameObject to you", NULL, 0, 0, 0 },
{ "delete", 'o', &ChatHandler::HandleGODelete, "Deletes selected GameObject", NULL, 0, 0, 0 },
{ "spawn", 'o', &ChatHandler::HandleGOSpawn, "Spawns a GameObject by ID", NULL, 0, 0, 0 },
{ "phase", 'o', &ChatHandler::HandleGOPhaseCommand, "<phase> <save> - Phase selected GameObject", NULL, 0, 0, 0 },
{ "info", 'o', &ChatHandler::HandleGOInfo, "Gives you information about selected GO", NULL, 0, 0, 0 },
{ "activate", 'o', &ChatHandler::HandleGOActivate, "Activates/Opens the selected GO.", NULL, 0, 0, 0 },
{ "enable", 'o', &ChatHandler::HandleGOEnable, "Enables the selected GO for use.", NULL, 0, 0, 0 },
Expand All @@ -380,7 +381,7 @@ void CommandTableStorage::Init()
{ "export", 'o', &ChatHandler::HandleGOExport, "Exports the current GO selected", NULL, 0, 0, 0 },
{ "move", 'g', &ChatHandler::HandleGOMove, "Moves gameobject to player xyz", NULL, 0, 0, 0 },
{ "rotate", 'g', &ChatHandler::HandleGORotate, "<Axis> <Value> - Rotates the object. <Axis> x,y, Default o.", NULL, 0, 0, 0 },
{ "sdid", 'g', &ChatHandler::HandleSpawnByDisplayId, "Spawns a generic game object with the specified display id. Clear your client cache after using this!", NULL, 0, 0, 0 },
{ "sdid", 'g', &ChatHandler::HandleSpawnByDisplayId, "Spawns a generic game object with the specified display id. Clear your client cache after using this!", NULL, 0, 0, 0 },
{ "portto", 'v', &ChatHandler::HandlePortToGameObjectSpawnCommand, "Teleports you to the gameobject with spawn id x.", NULL, 0, 0, 0 },
{ NULL, '0', NULL, "", NULL, 0, 0, 0 }
};
Expand Down Expand Up @@ -412,6 +413,7 @@ void CommandTableStorage::Init()
{ "emote", 'n', &ChatHandler::HandleEmoteCommand, ".emote - Sets emote state", NULL, 0, 0, 0 },
{ "delete", 'n', &ChatHandler::HandleDeleteCommand, "Deletes mob from db and world.", NULL, 0, 0, 0 },
{ "info", 'n', &ChatHandler::HandleNpcInfoCommand, "Displays NPC information", NULL, 0, 0, 0 },
{ "phase", 'n', &ChatHandler::HandleCreaturePhaseCommand, "<phase> <save> - Sets phase of selected mob", NULL, 0, 0, 0 },
{ "addAgent", 'n', &ChatHandler::HandleAddAIAgentCommand, ".npc addAgent <agent> <procEvent> <procChance> <procCount> <spellId> <spellType> <spelltargetType> <spellCooldown> <floatMisc1> <Misc2>", NULL, 0, 0, 0 },
{ "listAgent", 'n', &ChatHandler::HandleListAIAgentCommand, ".npc listAgent", NULL, 0, 0, 0 },
{ "say", 'n', &ChatHandler::HandleMonsterSayCommand, ".npc say <text> - Makes selected mob say text <text>.", NULL, 0, 0, 0 },
Expand Down Expand Up @@ -599,6 +601,7 @@ void CommandTableStorage::Init()
{ "forcerename", 'm', &ChatHandler::HandleForceRenameCommand, "Forces character x to rename his char next login", NULL, 0, 0, 0 },
{ "repairitems", 'n', &ChatHandler::HandleRepairItemsCommand, ".repairitems - Repair all items from selected player", NULL, 0, 0, 0 },
{ "settitle", 'm', &ChatHandler::HandleSetTitle, "Adds title to a player", NULL, 0, 0, 0 },
{ "phase", 'm', &ChatHandler::HandlePhaseCommand, "<phase> - Sets phase of selected player", NULL, 0, 0, 0 },
{ NULL, '0', NULL, "", NULL, 0, 0, 0 }
};
dupe_command_table(characterCommandTable, _characterCommandTable);
Expand Down Expand Up @@ -1355,4 +1358,4 @@ bool ChatHandler::HandleGetPosCommand(const char* args, WorldSession *m_session)
if(se)
BlueSystemMessage(m_session, "SpellIcon for %d is %d", se->Id, se->field114);
return true;
}
}
3 changes: 3 additions & 0 deletions src/arcemu-world/Chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class SERVER_DECL ChatHandler : public Singleton<ChatHandler>
bool HandleGmLogCommentCommand( const char *args , WorldSession *m_session);
bool HandleRatingsCommand( const char *args , WorldSession *m_session );
bool HandleSimpleDistanceCommand( const char *args , WorldSession *m_session );
bool HandlePhaseCommand( const char *args , WorldSession *m_session );

// Level 1 commands
bool CmdSetValueField(WorldSession *m_session, uint32 field, uint32 fieldmax, const char *fieldname, const char* args);
Expand Down Expand Up @@ -317,6 +318,7 @@ class SERVER_DECL ChatHandler : public Singleton<ChatHandler>
bool HandleGOSelect(const char *args, WorldSession *m_session);
bool HandleGODelete(const char *args, WorldSession *m_session);
bool HandleGOSpawn(const char *args, WorldSession *m_session);
bool HandleGOPhaseCommand(const char *args, WorldSession *m_session);
bool HandleGOInfo(const char *args, WorldSession *m_session);
bool HandleGOEnable(const char *args, WorldSession *m_session);
bool HandleGOActivate(const char* args, WorldSession *m_session);
Expand Down Expand Up @@ -357,6 +359,7 @@ class SERVER_DECL ChatHandler : public Singleton<ChatHandler>
bool HandleModifySkillCommand(const char* args, WorldSession *m_session);
bool HandleRemoveSkillCommand(const char* args, WorldSession *m_session);
bool HandleNpcInfoCommand(const char* args, WorldSession *m_session);
bool HandleCreaturePhaseCommand(const char *args, WorldSession *m_session);
bool HandleEmoteCommand(const char* args, WorldSession *m_session);
bool HandleIncreaseWeaponSkill(const char* args, WorldSession *m_session);
bool HandleCastSpellCommand(const char* args, WorldSession *m_session);
Expand Down
3 changes: 2 additions & 1 deletion src/arcemu-world/ChatHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
SendChatPacket(data, 1, lang, this);
for(set<Player*>::iterator itr = _player->m_inRangePlayers.begin(); itr != _player->m_inRangePlayers.end(); ++itr)
{
(*itr)->GetSession()->SendChatPacket(data, 1, lang, this);
if ( _player->GetPhase() & (*itr)->GetPhase() )
(*itr)->GetSession()->SendChatPacket(data, 1, lang, this);
}
}
delete data;
Expand Down
7 changes: 5 additions & 2 deletions src/arcemu-world/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,11 @@ void Creature::SaveToDB()
<< m_uint32Values[UNIT_VIRTUAL_ITEM_SLOT_ID+2] << ",";

if(GetAIInterface()->m_moveFly)
ss << 1 << ")";
ss << 1 << ",";
else
ss << 0 << ")";
ss << 0 << ",";

ss << m_phase << ")";

WorldDatabase.Execute(ss.str().c_str());
}
Expand Down Expand Up @@ -1160,6 +1162,7 @@ bool Creature::Load(CreatureSpawn *spawn, uint32 mode, MapInfo *info)
return false;

spawnid = spawn->id;
m_phase = spawn->phase;

m_walkSpeed = m_base_walkSpeed = proto->walk_speed; //set speeds
m_runSpeed = m_base_runSpeed = proto->run_speed; //set speeds
Expand Down
7 changes: 5 additions & 2 deletions src/arcemu-world/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ void GameObject::SaveToDB()
<< GetUInt32Value(GAMEOBJECT_FLAGS) << ","
<< GetUInt32Value(GAMEOBJECT_FACTION) << ","
<< GetFloatValue(OBJECT_FIELD_SCALE_X) << ","
<< "0)";
<< "0,"
<< m_phase << ")";
WorldDatabase.Execute(ss.str().c_str());

/* std::stringstream ss;
Expand Down Expand Up @@ -371,7 +372,8 @@ void GameObject::SaveToFile(std::stringstream & name)
<< GetUInt32Value(GAMEOBJECT_FLAGS) << ","
<< GetUInt32Value(GAMEOBJECT_FACTION) << ","
<< GetFloatValue(OBJECT_FIELD_SCALE_X) << ","
<< "0)";
<< "0,"
<< m_phase << ")";

FILE * OutFile;

Expand Down Expand Up @@ -498,6 +500,7 @@ bool GameObject::Load(GOSpawn *spawn)
return false;

m_spawn = spawn;
m_phase = spawn->phase;
//SetRotation(spawn->o);
SetUInt32Value(GAMEOBJECT_FLAGS,spawn->flags);
// SetUInt32Value(GAMEOBJECT_LEVEL,spawn->level);
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/InstanceCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ bool ChatHandler::HandleCreateInstanceCommand(const char * args, WorldSession *
if(mgr == NULL)
{
Log.Error("CreateInstanceGMCommand", "CreateInstance() call failed for map %u", mapid);
return NULL; // Shouldn't happen
return false; // Shouldn't happen
}
Log.Notice("CreateInstanceGMCommand", "GM created instance for map %u", mapid);

Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,4 +1272,4 @@ uint32 Item::CountGemsWithLimitId(uint32 LimitId)
}
}
return result;
}
}
2 changes: 1 addition & 1 deletion src/arcemu-world/ItemInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3785,4 +3785,4 @@ uint32 ItemInterface::GetItemCountByLimitId(uint32 LimitId, bool IncBank)
cnt += GetEquippedCountByItemLimit( LimitId );

return cnt;
}
}
23 changes: 23 additions & 0 deletions src/arcemu-world/Level0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,3 +520,26 @@ bool ChatHandler::HandlePlayMovie( const char *args, WorldSession *m_session )
return true;
}

bool ChatHandler::HandlePhaseCommand( const char *args , WorldSession *m_session )
{
Player *p_target = getSelectedChar(m_session, false);
if(!p_target || !p_target->IsPlayer())
return false;

if(strlen(args)<1) {
SystemMessage(m_session, "%s phase:%s%u",MSG_COLOR_GREEN,MSG_COLOR_LIGHTBLUE,p_target->GetPhase());
return true;
}

uint32 i = atoi(args);
p_target->Phase(PHASE_SET, i);

if( p_target->GetSession() )
{
WorldPacket data(SMSG_SET_PHASE_SHIFT, 4);
data << i;
p_target->GetSession()->SendPacket(&data);
}

return true;
}
Loading

0 comments on commit bee9f12

Please sign in to comment.