bool ChatHandler::HandleGODamageCommand( const char *args, WorldSession *session ){ GameObject *go = session->GetPlayer()->GetSelectedGo(); if( go == NULL ){ RedSystemMessage( session, "You need to select a GO first!" ); return true; } if( go->GetInfo()->Type != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING ){ RedSystemMessage( session, "The selected GO must be a destructible building!" ); return true; } if( *args == '\0' ){ RedSystemMessage( session, "You need to specify how much you want to damage the selected GO!" ); return true; } uint32 damage = 0; std::stringstream ss( args ); ss >> damage; if( ss.fail() ){ RedSystemMessage( session, "You need to specify how much you want to damage the selected GO!" ); return true; } uint64 guid = session->GetPlayer()->GetGUID(); BlueSystemMessage( session, "Attempting to damage GO..." ); go->Damage( damage, guid, guid, 0 ); return true; }
bool ChatHandler::HandleGORebuildCommand( const char *args, WorldSession *session ){ GameObject *go = session->GetPlayer()->GetSelectedGo(); if( go == NULL ){ RedSystemMessage( session, "You need to select a GO first!" ); return true; } if( go->GetInfo()->Type != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING ){ RedSystemMessage( session, "The selected GO must be a destructible building!" ); return true; } BlueSystemMessage( session, "Attempting to rebuild building..." ); go->Rebuild(); return true; }
void Spell::AddScriptedOrSpellFocusTargets(uint32 i, uint32 TargetType, float r, uint32 maxtargets) { for(ObjectSet::iterator itr = m_caster->GetInRangeSetBegin(); itr != m_caster->GetInRangeSetEnd(); ++itr) { Object* o = *itr; if(!o->IsGameObject()) continue; GameObject* go = TO_GAMEOBJECT(o); if(go->GetInfo()->TypeSpellFocus.FocusId == m_spellInfo->RequiresSpellFocus) { if(!m_caster->isInRange(go, r)) continue; bool success = AddTarget(i, TargetType, go); if(success) return; } } }
void Spell::AddScriptedOrSpellFocusTargets(uint32 i, uint32 TargetType, float r, uint32 maxtargets) { for (std::set< Object* >::iterator itr = m_caster->GetInRangeSetBegin(); itr != m_caster->GetInRangeSetEnd(); ++itr) { Object* o = *itr; if (!o->IsGameObject()) continue; GameObject* go = static_cast<GameObject*>(o); if (go->GetInfo()->parameter_0 == m_spellInfo->RequiresSpellFocus) { if (!m_caster->isInRange(go, r)) continue; bool success = AddTarget(i, TargetType, go); if (success) return; } } }
void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data ) { CHECK_INWORLD_RETURN; //WorldPacket data; uint32 option; uint32 unk24; uint64 guid; bool Coded = false; uint32 BoxMoney = 0; std::string BoxMessage; recv_data >> guid >> unk24 >> option; DEBUG_LOG("WORLD","CMSG_GOSSIP_SELECT_OPTION Option %i Guid %.8X", option, guid ); GossipScript * Script = NULL; Object* qst_giver = NULL; uint32 guidtype = GET_TYPE_FROM_GUID(guid); if(guidtype==HIGHGUID_TYPE_UNIT) { Creature* crt = _player->GetMapMgr()->GetCreature(GET_LOWGUID_PART(guid)); if(!crt) return; qst_giver=crt; Script=crt->GetCreatureInfo()?crt->GetCreatureInfo()->gossip_script:NULL; } else if(guidtype==HIGHGUID_TYPE_ITEM) { Item* pitem = _player->GetItemInterface()->GetItemByGUID(guid); if(pitem==NULL) return; qst_giver=pitem; Script=pitem->GetProto()->gossip_script; } else if(guidtype==HIGHGUID_TYPE_GAMEOBJECT) { GameObject* gobj = _player->GetMapMgr()->GetGameObject(GET_LOWGUID_PART(guid)); if(!gobj) return; qst_giver=gobj; Script=gobj->GetInfo()->gossip_script; } if(!Script||!qst_giver) return; uint32 IntId = 1; if(_player->CurrentGossipMenu) { GossipMenuItem item = _player->CurrentGossipMenu->GetItem(option); IntId = item.IntId; Coded = item.Coded; } if(Coded) { if(recv_data.rpos()!=recv_data.wpos()) recv_data >> BoxMessage; Script->GossipSelectOption(qst_giver, _player, option, IntId, BoxMessage.c_str()); } else
////////////////////////////////////////////////////////////// /// This function handles CMSG_GOSSIP_SELECT_OPTION: ////////////////////////////////////////////////////////////// void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data ) { if(!_player->IsInWorld()) return; //WorldPacket data; uint32 option; uint32 unk24; uint64 guid; int8 extra=0; recv_data >> guid >> unk24 >> option; sLog.outDetail("WORLD: CMSG_GOSSIP_SELECT_OPTION Option %i Guid %.8X", option, guid ); GossipScript * Script= NULL; Object * qst_giver= NULL; uint32 guidtype = GET_TYPE_FROM_GUID(guid); if(guidtype==HIGHGUID_TYPE_UNIT) { Creature *crt = _player->GetMapMgr()->GetCreature(GET_LOWGUID_PART(guid)); if(!crt) return; qst_giver=crt; Script=crt->GetCreatureInfo()?crt->GetCreatureInfo()->gossip_script:NULL; } else if(guidtype==HIGHGUID_TYPE_ITEM) { Item * pitem = _player->GetItemInterface()->GetItemByGUID(guid); if(pitem== NULL) return; qst_giver=pitem; Script=pitem->GetProto()->gossip_script; } else if(guidtype==HIGHGUID_TYPE_GAMEOBJECT) { GameObject *gobj = _player->GetMapMgr()->GetGameObject(GET_LOWGUID_PART(guid)); if(!gobj) return; qst_giver=gobj; Script=gobj->GetInfo()->gossip_script; } if(!Script||!qst_giver) return; uint32 IntId = 1; if(_player->CurrentGossipMenu) { GossipMenuItem item = _player->CurrentGossipMenu->GetItem(option); IntId = item.IntId; extra = item.Extra; } if(extra) { string str; if(recv_data.rpos()!=recv_data.wpos()) recv_data >> str; Script->GossipSelectOption(qst_giver, _player, option, IntId, str.c_str()); } else
void GameObject::UseFishingNode(Player *player) { sEventMgr.RemoveEvents( this ); if( GetUInt32Value( GAMEOBJECT_FLAGS ) != 32 ) // Clicking on the bobber before something is hooked { player->GetSession()->OutPacket( SMSG_FISH_NOT_HOOKED ); EndFishing( player, true ); return; } /* Unused code: sAreaStore.LookupEntry(GetMapMgr()->GetAreaID(GetPositionX(),GetPositionY()))->ZoneId*/ uint32 zone = player->GetAreaID(); if( zone == 0 ) // If the player's area ID is 0, use the zone ID instead zone = player->GetZoneId(); FishingZoneEntry *entry = FishingZoneStorage.LookupEntry( zone ); if( entry == NULL ) // No fishing information found for area or zone, log an error, and end fishing { sLog.outError( "ERROR: Fishing zone information for zone %d not found!", zone ); EndFishing( player, true ); return; } uint32 maxskill = entry->MaxSkill; uint32 minskill = entry->MinSkill; if( player->_GetSkillLineCurrent( SKILL_FISHING, false ) < maxskill ) player->_AdvanceSkillLine( SKILL_FISHING, float2int32( 1.0f * sWorld.getRate( RATE_SKILLRATE ) ) ); GameObject * school = NULL; this->AquireInrangeLock(); //make sure to release lock before exit function ! for ( InRangeSet::iterator it = GetInRangeSetBegin(); it != GetInRangeSetEnd(); ++it ) { if ( (*it) == NULL || (*it)->GetTypeId() != TYPEID_GAMEOBJECT || (*it)->GetUInt32Value(GAMEOBJECT_TYPE_ID) != GAMEOBJECT_TYPE_FISHINGHOLE) continue; school = static_cast<GameObject *>( *it ); if ( !isInRange( school, (float)school->GetInfo()->sound1 ) ) { school = NULL; continue; } else break; } this->ReleaseInrangeLock(); if ( school != NULL ) // open school loot if school exists { lootmgr.FillGOLoot( &school->loot, school->GetEntry(), school->GetMapMgr() ? ( school->GetMapMgr()->iInstanceMode ? true : false ) : false ); player->SendLoot( school->GetGUID(), LOOT_FISHING ); EndFishing( player, false ); school->CatchFish(); if ( !school->CanFish() ) sEventMgr.AddEvent( school, &GameObject::Despawn, ( 1800000 + RandomUInt( 3600000 ) ), EVENT_GAMEOBJECT_EXPIRE, 10000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT ); // respawn in 30 - 90 minutes } else if( Rand( ( ( player->_GetSkillLineCurrent( SKILL_FISHING, true ) - minskill ) * 100 ) / maxskill ) ) // Open loot on success, otherwise FISH_ESCAPED. { lootmgr.FillFishingLoot( &loot, zone ); player->SendLoot( GetGUID(), LOOT_FISHING ); EndFishing( player, false ); } else // Failed { player->GetSession()->OutPacket( SMSG_FISH_ESCAPED ); EndFishing( player, true ); } }
void AlteracValley::SpawnBattleground() { // Alliance Gate /*GameObject *gate = SpawnGameObject(180255, 529, 1284.597290, 1281.166626, -15.977916, 0.706859, 32, 114, 1.5799990); gate->SetFloatValue(GAMEOBJECT_ROTATION,0.0129570); gate->SetFloatValue(GAMEOBJECT_ROTATION_01,-0.0602880); gate->SetFloatValue(GAMEOBJECT_ROTATION_02,0.3449600); gate->SetFloatValue(GAMEOBJECT_ROTATION_03,0.9365900); m_Gates.insert(gate); // Horde Gate gate = SpawnGameObject(180256, 529, 708.0902710, 708.4479370, -17.3898964, -2.3910990, 32, 114, 1.5699990); gate->SetFloatValue(GAMEOBJECT_ROTATION,0.0502910); gate->SetFloatValue(GAMEOBJECT_ROTATION_01,0.0151270); gate->SetFloatValue(GAMEOBJECT_ROTATION_02,0.9292169); gate->SetFloatValue(GAMEOBJECT_ROTATION_03,-0.3657840); m_Gates.insert(gate);*/ // -- Places Banners -- // Frostworlf gravyard GameObject *pbanner = SpawnGameObject(178393 ,30 ,-1083.244385 ,-345.994507 ,55.124435 ,4.596910, 32, 84, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 0; // Iceblood graveyard pbanner = SpawnGameObject(178393, 30 ,-612.329285 ,-396.660095 ,60.858463 ,2.916166, 32, 84, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 1; // Stormpike gravyard pbanner = SpawnGameObject(178389, 30 ,669.968567 ,-293.467468 ,30.283821 ,3.152932, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 2; // Stoneheart gravyard pbanner = SpawnGameObject(178389, 30 ,78.205989 ,-405.1715 ,47.11583 ,1.535766, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 3; // Relief hunt pbanner = SpawnGameObject(178393, 30 ,-1403.875000 ,-309.393738 ,89.372269 ,0.204413, 32, 84, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 4; // Stormpike aid station pbanner = SpawnGameObject(178389, 30 ,639.348206 ,-31.571268 ,46.222248 ,4.638909, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); if(pbanner->GetInfo()->sound3) { pbanner->pcbannerAura = SpawnGameObject(pbanner->GetInfo()->sound3, 30, pbanner->GetPositionX(), pbanner->GetPositionY(), pbanner->GetPositionZ(), pbanner->GetOrientation(), 32, 114, 5); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->pcbannerAura->AddToWorld(); } pbanner->bannerslot = 5; // iceblood tower pbanner = SpawnGameObject(178946, 30 ,-571.080994 ,-263.751007 ,75.092003 ,5.410520, 32, 84, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); pbanner->bannerslot = 6; // Stoneheart bunker pbanner = SpawnGameObject(178935, 30 ,-149.734329 ,-441.907593 ,40.386887 ,4.147903, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); pbanner->bannerslot = 7; // Icewing bunker pbanner = SpawnGameObject(178935, 30 ,204.959793 ,-357.945190 ,56.377651 ,5.133710, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); pbanner->bannerslot = 8; // stormpike north bunker pbanner = SpawnGameObject(178935, 30 ,670.908020 ,-142.491776 ,63.662659 ,0.876855, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); pbanner->bannerslot = 9; // stormpike south bunker pbanner = SpawnGameObject(178935, 30 ,555.507324 ,-76.193176 ,51.934444 ,4.996268, 32, 83, 1); pbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pbanner->AddToWorld(); pbanner->bannerslot = 10; bSpawned = true; }
void AlteracValley::HandleBanner(Player *p_caster,GameObject *go,uint32 spellid) { int32 bannerslot = go->bannerslot; // spawn contest banner if(bannerslot > -1 && bannerslot < MAXOFBANNERS) { sEventMgr.RemoveEvents(this,EVENT_BATTLEGROUND_AV_CAPTURE_BASE + bannerslot); // If whe contest a horde/alliance flag, he loses the base /*uint32 rbasesfield = p_caster->m_bgTeam ? AB_ALLIANCE_CAPTUREBASE : AB_HORDE_CAPTUREBASE; if(go->GetEntry() == 180078 || go->GetEntry() == 180076) { uint64 guid = p_caster->GetGUID(); std::map<uint64, BattlegroundScore>::iterator itr = m_PlayerScores.find(guid); if(itr == m_PlayerScores.end()) { SendMessageToPlayer(p_caster, "INTERNAL ERROR: Could not find in internal player score map!", true); return; } itr->second.FlagReturns++; UpdatePVPData(); SetWorldStateValue(rbasesfield,WorldStateVars[rbasesfield]-1); }*/ uint32 goentry = 0; if(bannerslot < 6) // outside flags are diferent goentry = p_caster->m_bgTeam ? 180420:180419; else goentry = p_caster->m_bgTeam ? 179435:178940; gcbanner[bannerslot] = SpawnGameObject(goentry, 30, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetOrientation(), 32, 83, 1); GameObject *pcbanner = gcbanner[bannerslot]; pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_02,go->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_03,go->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pcbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->SetUInt32Value(GAMEOBJECT_DYN_FLAGS,1); pcbanner->bannerslot = bannerslot; pcbanner->AddToWorld(); if(pcbanner->GetInfo()->sound3) { pcbanner->pcbannerAura = SpawnGameObject(pcbanner->GetInfo()->sound3, 30, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetOrientation(), 32, 114, 5); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,go->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,go->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->pcbannerAura->AddToWorld(); } if(go->pcbannerAura) { if( go->pcbannerAura->IsInWorld() ) go->pcbannerAura->RemoveFromWorld(); delete go->pcbannerAura; } if( go->IsInWorld() ) go->RemoveFromWorld(); delete go; char message[300]; static char *resnames[11] = {"Frostworlf Gravyard","Iceblood Graveyard","Stormpike Gravyard", "Stoneheart gravyard","Relief Hunt","Stormpike Aid Station", "Iceblood Tower","Stoneheart Bunker","Icewing Bunker", "Stormpike North Bunker","Stormpike South Bunker"}; snprintf(message, 300, "$N claims the %s! If left unchallenged, the %s will control it in 1 minute!", resnames[bannerslot] , p_caster->m_bgTeam ? "Horde" : "Alliance" ); WorldPacket *data = BuildMessageChat(p_caster->m_bgTeam ? 0x54:0x53, 0, message, 0,p_caster->GetGUID()); SendPacketToAll(data); delete data; sEventMgr.AddEvent(this, &AlteracValley::EventCaptureBase, p_caster, (uint32)bannerslot, EVENT_BATTLEGROUND_AV_CAPTURE_BASE + bannerslot, 60000, 1); } }
void AlteracValley::EventCaptureBase(Player *src,uint32 bannerslot) { if(!gcbanner[bannerslot]) return; /*uint64 guid = src->GetGUID(); std::map<uint64, BattlegroundScore>::iterator itr = m_PlayerScores.find(guid); if(itr == m_PlayerScores.end()) { SendMessageToPlayer(src, "INTERNAL ERROR: Could not find in internal player score map!", true); return; } itr->second.FlagCaptures++; UpdatePVPData();*/ //uint32 rbasesfield = src->m_bgTeam ? AB_HORDE_CAPTUREBASE : AB_ALLIANCE_CAPTUREBASE; uint32 goentry = 0; if(bannerslot < 6) // outside flags are diferent goentry = src->m_bgTeam ? 178393:178389; else goentry = src->m_bgTeam ? 178946:178935; GameObject *pcbanner = src->GetCurrentBattleground()->SpawnGameObject(goentry, 30, gcbanner[bannerslot]->GetPositionX(), gcbanner[bannerslot]->GetPositionY(), gcbanner[bannerslot]->GetPositionZ(), gcbanner[bannerslot]->GetOrientation(), 32, src->m_bgTeam ?84:83, 1); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_02,gcbanner[bannerslot]->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_03,gcbanner[bannerslot]->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pcbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->AddToWorld(); if(pcbanner->GetInfo()->sound3) { pcbanner->pcbannerAura = src->GetCurrentBattleground()->SpawnGameObject(pcbanner->GetInfo()->sound3, 30, pcbanner->GetPositionX(), pcbanner->GetPositionY(), pcbanner->GetPositionZ(), pcbanner->GetOrientation(), 32, 114, 5); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pcbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pcbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->pcbannerAura->AddToWorld(); } if(gcbanner[bannerslot]->pcbannerAura) { if( gcbanner[bannerslot]->pcbannerAura->IsInWorld() ) gcbanner[bannerslot]->pcbannerAura->RemoveFromWorld(); delete gcbanner[bannerslot]->pcbannerAura; } if( gcbanner[bannerslot]->IsInWorld() ) gcbanner[bannerslot]->RemoveFromWorld(); delete gcbanner[bannerslot]; gcbanner[bannerslot] = NULL; // Play sound WorldPacket pkt; pkt.Initialize(SMSG_PLAY_SOUND); pkt << uint32(src->m_bgTeam ? SOUND_HORDE_CAPTURE : SOUND_ALLIANCE_CAPTURE); SendPacketToAll(&pkt); char message[300]; static char *resnames[11] = {"Frostworlf Gravyard","Iceblood Graveyard","Stormpike Gravyard", "Stoneheart gravyard","Relief Hunt","Stormpike Aid Station", "Iceblood Tower","Stoneheart Bunker","Icewing Bunker", "Stormpike North Bunker","Stormpike South Bunker"}; snprintf(message, 300, "The %s has taken the %s!", src->m_bgTeam ? "Horde" : "Alliance" , resnames[bannerslot] ); WorldPacket *data = BuildMessageChat(src->m_bgTeam ? 0x54:0x53, 0x27, message, 0); SendPacketToAll(data); delete data; }
bool ChatHandler::HandleGOInfo(const char *args, WorldSession *m_session) { std::stringstream sstext; GameObject *GObj = NULL; GObj = m_session->GetPlayer()->m_GM_SelectedGO; if( !GObj ) { RedSystemMessage(m_session, "No selected GameObject..."); return true; } WhiteSystemMessage(m_session, "Information:"); if(GObj->m_spawn) GreenSystemMessage(m_session, "SpawnID: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->m_spawn->id); GreenSystemMessage(m_session, "Entry: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetEntry()); GreenSystemMessage(m_session, "Model: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetDisplayId()); GreenSystemMessage(m_session, "State: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetState()); GreenSystemMessage(m_session, "flags: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetFlags()); GreenSystemMessage(m_session, "dynflags: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetUInt32Value(GAMEOBJECT_DYNAMIC)); GreenSystemMessage(m_session, "faction: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetUInt32Value(GAMEOBJECT_FACTION)); std::stringstream gottext; uint8 type = GObj->GetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_TYPE_ID); switch(type) { case GAMEOBJECT_TYPE_DOOR: gottext << "Door"; break; case GAMEOBJECT_TYPE_BUTTON: gottext << "Button"; break; case GAMEOBJECT_TYPE_QUESTGIVER: gottext << "Quest Giver"; break; case GAMEOBJECT_TYPE_CHEST: gottext << "Chest"; break; case GAMEOBJECT_TYPE_BINDER: gottext << "Binder"; break; case GAMEOBJECT_TYPE_GENERIC: gottext << "Generic"; break; case GAMEOBJECT_TYPE_TRAP: gottext << "Trap"; break; case GAMEOBJECT_TYPE_CHAIR: gottext << "Chair"; break; case GAMEOBJECT_TYPE_SPELL_FOCUS: gottext << "Spell Focus"; break; case GAMEOBJECT_TYPE_TEXT: gottext << "Text"; break; case GAMEOBJECT_TYPE_GOOBER: gottext << "Goober"; break; case GAMEOBJECT_TYPE_TRANSPORT: gottext << "Transport"; break; case GAMEOBJECT_TYPE_AREADAMAGE: gottext << "Area Damage"; break; case GAMEOBJECT_TYPE_CAMERA: gottext << "Camera"; break; case GAMEOBJECT_TYPE_MAP_OBJECT: gottext << "Map Object"; break; case GAMEOBJECT_TYPE_MO_TRANSPORT: gottext << "Mo Transport"; break; case GAMEOBJECT_TYPE_DUEL_ARBITER: gottext << "Duel Arbiter"; break; case GAMEOBJECT_TYPE_FISHINGNODE: gottext << "Fishing Node"; break; case GAMEOBJECT_TYPE_RITUAL: gottext << "Ritual"; break; case GAMEOBJECT_TYPE_MAILBOX: gottext << "Mailbox"; break; case GAMEOBJECT_TYPE_AUCTIONHOUSE: gottext << "Auction House"; break; case GAMEOBJECT_TYPE_GUARDPOST: gottext << "Guard Post"; break; case GAMEOBJECT_TYPE_SPELLCASTER: gottext << "Spell Caster"; break; case GAMEOBJECT_TYPE_MEETINGSTONE: gottext << "Meeting Stone"; break; case GAMEOBJECT_TYPE_FLAGSTAND: gottext << "Flag Stand"; break; case GAMEOBJECT_TYPE_FISHINGHOLE: gottext << "Fishing Hole"; break; case GAMEOBJECT_TYPE_FLAGDROP: gottext << "Flag Drop"; break; case GAMEOBJECT_TYPE_MINI_GAME: gottext << "Mini Game"; break; case GAMEOBJECT_TYPE_LOTTERY_KIOSK: gottext << "Lottery KIOSK"; break; case GAMEOBJECT_TYPE_CAPTURE_POINT: gottext << "Capture Point"; break; case GAMEOBJECT_TYPE_AURA_GENERATOR: gottext << "Aura Generator"; break; case GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY: gottext << "Dungeon Difficulty"; break; case GAMEOBJECT_TYPE_BARBER_CHAIR: gottext << "Barber Chair"; break; case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING: gottext << "Destructible Building"; break; case GAMEOBJECT_TYPE_GUILD_BANK: gottext << "Guild Bank"; break; case GAMEOBJECT_TYPE_TRAPDOOR: gottext << "Trap Door"; break; default: gottext << "Unknown."; break; } GreenSystemMessage(m_session, "Type: %s%u|r -- %s", MSG_COLOR_LIGHTBLUE, type, gottext.str().c_str()); GreenSystemMessage(m_session, "Distance: %s%f|r", MSG_COLOR_LIGHTBLUE, GObj->CalcDistance((Object*)m_session->GetPlayer())); GreenSystemMessage(m_session, "Size: %s%f|r", MSG_COLOR_LIGHTBLUE, GObj->GetFloatValue(OBJECT_FIELD_SCALE_X)); if(GObj->GetInfo()) GreenSystemMessage(m_session, "Name: %s%s|r", MSG_COLOR_LIGHTBLUE, GObj->GetInfo()->Name); GreenSystemMessage(m_session, "Phase: %s%u|r", MSG_COLOR_LIGHTBLUE, GObj->GetPhaseMask()); SystemMessage(m_session, sstext.str().c_str()); return true; }