From 4439ae690f64b93c563c8960a262205f868a0bbe Mon Sep 17 00:00:00 2001 From: Rat Date: Wed, 15 Apr 2009 19:28:01 +0200 Subject: *fix some boss pull/kill exploits - Hexlord (zulaman) - Janalai (zulaman) - Delrissa (magister) --HG-- branch : trunk --- .../zone/magisters_terrace/boss_priestess_delrissa.cpp | 14 ++++++++++++++ src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp | 12 ++++++++++++ src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp | 11 +++++++---- 3 files changed, 33 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp index e45d3862867..36ec57a4e25 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp @@ -114,6 +114,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI uint32 ShieldTimer; uint32 SWPainTimer; uint32 DispelTimer; + uint32 ResetTimer; uint32 CombatPulseTimer; // Periodically puts all players in the instance in combat @@ -130,6 +131,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI ShieldTimer = 2000; SWPainTimer = 5000; DispelTimer = 7500; + ResetTimer = 5000; CombatPulseTimer = 5000; @@ -255,6 +257,18 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI if(!UpdateVictim()) return; + if(ResetTimer < diff) + { + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if(m_creature->GetPositionZ() >= z+10) + { + EnterEvadeMode(); + return; + } + ResetTimer = 5000; + }else ResetTimer -= diff; + if(HealTimer < diff) { uint32 health = m_creature->GetHealth(); diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp index 51de70ed733..8792a988c6f 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp @@ -217,6 +217,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI uint32 SiphonSoul_Timer; uint32 PlayerAbility_Timer; uint32 CheckAddState_Timer; + uint32 ResetTimer; uint32 PlayerClass; @@ -232,6 +233,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI SiphonSoul_Timer = 100000; PlayerAbility_Timer = 99999; CheckAddState_Timer = 5000; + ResetTimer = 5000; SpawnAdds(); @@ -333,6 +335,16 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI if(!UpdateVictim() ) return; + if(ResetTimer < diff) + { + if(m_creature->GetDistance(119.223,1035.45,29.4481) <= 10) + { + EnterEvadeMode(); + return; + } + ResetTimer = 5000; + }else ResetTimer -= diff; + if(CheckAddState_Timer < diff) { for(uint8 i = 0; i < 4; ++i) diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp index c5db3ddd8fd..c70bd007c58 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp @@ -419,10 +419,13 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI if(ResetTimer < diff) { - /*float x, y, z; - m_creature->GetPosition(x, y, z); - if(x < -70 || x > 0 || y > 1176 || y < 1121 || z < 18) - EnterEvadeMode();*/ + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if(m_creature->GetPositionZ() <= z-7) + { + EnterEvadeMode(); + return; + } ResetTimer = 5000; }else ResetTimer -= diff; -- cgit v1.2.3 From 09b4ef5f76d0ef541d8e7c2669f67636ea5c2db9 Mon Sep 17 00:00:00 2001 From: Rat Date: Wed, 15 Apr 2009 21:21:41 +0200 Subject: *enable EvantAI to summon gameobject +tabs2spaces --HG-- branch : trunk --- src/bindings/scripts/docs/EventAI.txt | 1 + .../scripts/scripts/creature/mob_event_ai.cpp | 19 ++++++++++++++++--- src/bindings/scripts/scripts/creature/mob_event_ai.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/docs/EventAI.txt b/src/bindings/scripts/docs/EventAI.txt index 580f73ae75b..37064b63e8b 100644 --- a/src/bindings/scripts/docs/EventAI.txt +++ b/src/bindings/scripts/docs/EventAI.txt @@ -120,6 +120,7 @@ Params are always read from Param1, then Param2, then Param3. 36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true 37 ACTION_T_DIE No Params Kills the creature 38 ACTION_T_ZONE_COMBAT_PULSE No Params Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. +39 ACTION_T_SUMMON_GO GameObjectID, DespawnTime Summons object (param1). Despawns after param2. Spawns on top of current creature. DespawnTime is in ms. * = Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2) diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 9c0bf637429..c25fa7c1eb8 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1000,6 +1000,20 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI DoZoneInCombat(); } break; + case ACTION_T_SUMMON_GO: + { + GameObject* pObject = NULL; + + float x,y,z,rx,ry,rz; + m_creature->GetPosition(x,y,z); + pObject = m_creature->SummonGameObject(param1, x, y, z, 0, 0, 0, 0, 0, param2); + if (!pObject) + { + if (EAI_ErrorLevel > 0) + error_db_log( "SD2: EventAI failed to spawn object %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry()); + } + } + break; // TRINITY ONLY case ACTION_T_SET_ACTIVE: @@ -1396,9 +1410,8 @@ CreatureAI* GetAI_Mob_EventAI(Creature *pCreature) #endif if( pCreature->GetMap()->IsDungeon() ) { - if ((pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) || - (!pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL)) - EventList.push_back(EventHolder(*i)); + if ((pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) || (!pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL)) + EventList.push_back(EventHolder(*i)); continue; } diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h index aff54b824f4..7b00d9d7942 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.h +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h @@ -76,6 +76,7 @@ enum Action_Types ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team ACTION_T_DIE = 37, //No Params ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params + ACTION_T_SUMMON_GO = 39, //GameObjectID, DespawnTime in ms ACTION_T_SET_ACTIVE = 101, //Apply ACTION_T_SET_AGGRESSIVE = 102, //Apply -- cgit v1.2.3 From 96ffb827ae8ad6661247fec0835f012a3bdc5281 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 16 Apr 2009 00:11:48 +0200 Subject: *Better names for var Modelid. --HG-- branch : trunk --- .../scripts/scripts/creature/mob_event_ai.cpp | 4 ++-- src/game/Creature.cpp | 20 +++++++++--------- src/game/Creature.h | 8 ++++---- src/game/Object.cpp | 8 ++++---- src/game/ObjectMgr.cpp | 24 +++++++++++----------- src/game/QueryHandler.cpp | 10 ++++----- src/game/Totem.cpp | 16 +++++++-------- 7 files changed, 45 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index c25fa7c1eb8..957d14d7b22 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -605,8 +605,8 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI if (CreatureInfo const* ci = GetCreatureTemplateStore(param1)) { //use default display - if (ci->Modelid1) - m_creature->SetDisplayId(ci->Modelid1); + if (ci->Modelid_A1) + m_creature->SetDisplayId(ci->Modelid_A1); } } //if no param1, then use value from param2 (modelId) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index c69ae6e8d16..f86df8485df 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -100,20 +100,20 @@ uint32 CreatureInfo::GetRandomValidModelId() const uint32 c = 0; uint32 modelIDs[4]; - if (Modelid1) modelIDs[c++] = Modelid1; - if (Modelid2) modelIDs[c++] = Modelid2; - if (Modelid3) modelIDs[c++] = Modelid3; - if (Modelid4) modelIDs[c++] = Modelid4; + if (Modelid_A1) modelIDs[c++] = Modelid_A1; + if (Modelid_A2) modelIDs[c++] = Modelid_A2; + if (Modelid_H1) modelIDs[c++] = Modelid_H1; + if (Modelid_H2) modelIDs[c++] = Modelid_H2; return ((c>0) ? modelIDs[urand(0,c-1)] : 0); } uint32 CreatureInfo::GetFirstValidModelId() const { - if(Modelid1) return Modelid1; - if(Modelid2) return Modelid2; - if(Modelid3) return Modelid3; - if(Modelid4) return Modelid4; + if(Modelid_A1) return Modelid_A1; + if(Modelid_A2) return Modelid_A2; + if(Modelid_H1) return Modelid_H1; + if(Modelid_H2) return Modelid_H2; return 0; } @@ -1189,8 +1189,8 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask) CreatureInfo const *cinfo = GetCreatureInfo(); if(cinfo) { - if(displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 || - displayId == cinfo->Modelid3 || displayId == cinfo->Modelid4) displayId = 0; + if(displayId == cinfo->Modelid_A1 || displayId == cinfo->Modelid_A2 || + displayId == cinfo->Modelid_H1 || displayId == cinfo->Modelid_H2) displayId = 0; } // data->guid = guid don't must be update at save diff --git a/src/game/Creature.h b/src/game/Creature.h index 6c59f325d3d..5a8fd48f97d 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -150,10 +150,10 @@ struct CreatureInfo { uint32 Entry; uint32 HeroicEntry; - uint32 Modelid1; - uint32 Modelid2; - uint32 Modelid3; - uint32 Modelid4; + uint32 Modelid_A1; + uint32 Modelid_A2; + uint32 Modelid_H1; + uint32 Modelid_H2; char* Name; char* SubName; char* IconName; diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 956b327820a..d106b578004 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -598,15 +598,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask { if(target->isGameMaster()) { - if(cinfo->Modelid2) - *data << cinfo->Modelid1; + if(cinfo->Modelid_A2) + *data << cinfo->Modelid_A1; else *data << 17519; // world invisible trigger's model } else { - if(cinfo->Modelid2) - *data << cinfo->Modelid2; + if(cinfo->Modelid_A2) + *data << cinfo->Modelid_A2; else *data << 11686; // world invisible trigger's model } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 408d46ceb62..31697f31df0 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -566,25 +566,25 @@ void ObjectMgr::LoadCreatureTemplates() sLog.outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u)", cInfo->Entry, cInfo->faction_H); // check model ids, supplying and sending non-existent ids to the client might crash them - if(cInfo->Modelid1 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid1)) + if(cInfo->Modelid_A1 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid_A1)) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A (%u), setting it to 0", cInfo->Entry, cInfo->Modelid1); - const_cast(cInfo)->Modelid1 = 0; + sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_A1 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_A1); + const_cast(cInfo)->Modelid_A1 = 0; } - if(cInfo->Modelid2 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid2)) + if(cInfo->Modelid_A2 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid_A2)) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid2); - const_cast(cInfo)->Modelid2 = 0; + sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_A2); + const_cast(cInfo)->Modelid_A2 = 0; } - if(cInfo->Modelid3 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid3)) + if(cInfo->Modelid_H1 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid_H1)) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H (%u), setting it to 0", cInfo->Entry, cInfo->Modelid3); - const_cast(cInfo)->Modelid3 = 0; + sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_H1 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_H1); + const_cast(cInfo)->Modelid_H1 = 0; } - if(cInfo->Modelid4 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid4)) + if(cInfo->Modelid_H2 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid_H2)) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid4); - const_cast(cInfo)->Modelid4 = 0; + sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_H2); + const_cast(cInfo)->Modelid_H2 = 0; } if(cInfo->dmgschool >= MAX_SPELL_SCHOOL) diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index f7777367771..6a99703dbc4 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -181,16 +181,16 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data ) data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty data << SubName; data << ci->IconName; // "Directions" for guard, string for Icons 2.3.0 - data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1 + data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1 data << (uint32)ci->type; data << (uint32)ci->family; // family wdbFeild9 data << (uint32)ci->rank; // rank wdbFeild10 data << (uint32)0; // unknown wdbFeild11 data << (uint32)ci->PetSpellDataId; // Id from CreatureSpellData.dbc wdbField12 - data << (uint32)ci->Modelid1; // Modelid1 - data << (uint32)ci->Modelid2; // Modelid2 - data << (uint32)ci->Modelid3; // Modelid3 - data << (uint32)ci->Modelid4; // Modelid4 + data << (uint32)ci->Modelid_A1; // Modelid_A1 + data << (uint32)ci->Modelid_A2; // Modelid_A2 + data << (uint32)ci->Modelid_H1; // Modelid_H1 + data << (uint32)ci->Modelid_H2; // Modelid_H2 data << (float)1.0f; // unk data << (float)1.0f; // unk data << (uint8)ci->RacialLeader; diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 2889f6f9188..de58a7ef15f 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -62,17 +62,17 @@ void Totem::Summon(Unit* owner) uint32 modelid = 0; if(((Player*)owner)->GetTeam() == HORDE) { - if(cinfo->Modelid3) - modelid = cinfo->Modelid3; - else if(cinfo->Modelid4) - modelid = cinfo->Modelid4; + if(cinfo->Modelid_H1) + modelid = cinfo->Modelid_H1; + else if(cinfo->Modelid_H2) + modelid = cinfo->Modelid_H2; } else { - if(cinfo->Modelid1) - modelid = cinfo->Modelid1; - else if(cinfo->Modelid2) - modelid = cinfo->Modelid2; + if(cinfo->Modelid_A1) + modelid = cinfo->Modelid_A1; + else if(cinfo->Modelid_A2) + modelid = cinfo->Modelid_A2; } if (modelid) SetDisplayId(modelid); -- cgit v1.2.3 From 0bec4479972e76c00feac306c1d0cabfd043880a Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 16 Apr 2009 17:42:54 +0200 Subject: * Add loading of missing map field in ticket system, typo pointed out by Disassembler. --HG-- branch : trunk --- src/game/TicketMgr.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/TicketMgr.cpp b/src/game/TicketMgr.cpp index f3cbe848e78..5b5ecf5a9fb 100644 --- a/src/game/TicketMgr.cpp +++ b/src/game/TicketMgr.cpp @@ -122,13 +122,14 @@ void TicketMgr::LoadGMTickets() ticket->name = fields[2].GetString(); ticket->message = fields[3].GetString(); ticket->createtime = fields[4].GetUInt64(); - ticket->pos_x = fields[5].GetFloat(); - ticket->pos_y = fields[6].GetFloat(); - ticket->pos_z = fields[7].GetFloat(); - ticket->timestamp = fields[8].GetUInt64(); - ticket->closed = fields[9].GetUInt64(); - ticket->assignedToGM = fields[10].GetUInt64(); - ticket->comment = fields[11].GetString(); + ticket->map = fields[5].GetUInt32(); + ticket->pos_x = fields[6].GetFloat(); + ticket->pos_y = fields[7].GetFloat(); + ticket->pos_z = fields[8].GetFloat(); + ticket->timestamp = fields[9].GetUInt64(); + ticket->closed = fields[10].GetUInt64(); + ticket->assignedToGM = fields[11].GetUInt64(); + ticket->comment = fields[12].GetString(); AddGMTicket(ticket, true); -- cgit v1.2.3 From 6a53bada669c58393ec13c9bacd199c154fe023a Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 16 Apr 2009 20:41:00 +0200 Subject: *removed not used vars from EAI --HG-- branch : trunk --- src/bindings/scripts/scripts/creature/mob_event_ai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 957d14d7b22..b1af88b948f 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1004,7 +1004,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI { GameObject* pObject = NULL; - float x,y,z,rx,ry,rz; + float x,y,z; m_creature->GetPosition(x,y,z); pObject = m_creature->SummonGameObject(param1, x, y, z, 0, 0, 0, 0, 0, param2); if (!pObject) -- cgit v1.2.3