TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
go_wind_stone Class Reference

Public Member Functions

 go_wind_stone ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
bool OnGossipSelect (Player *player, GameObject *go, uint32, uint32 action) override
 
- Public Member Functions inherited from GameObjectScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, GameObject *)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Private Member Functions

uint8 GetPlayerRank (Player *player)
 
uint8 GetItems (Player *player, WS type)
 
void SummonNPC (GameObject *go, Player *player, uint32 npc, uint32 spell)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

go_wind_stone::go_wind_stone ( )
inline
1219 : GameObjectScript("go_wind_stone") { }
GameObjectScript(const char *name)
Definition: ScriptMgr.cpp:1592

Member Function Documentation

uint8 go_wind_stone::GetItems ( Player player,
WS  type 
)
inlineprivate
1239  {
1240  uint8 result = 0x0;
1241 
1242  switch (type)
1243  {
1244  case TEMPLAR:
1245  {
1246  if (player->HasItemCount(ITEM_TEMPLAR_FIRE))
1247  result |= FIRE;
1248  if (player->HasItemCount(ITEM_TEMPLAR_WATER))
1249  result |= WATER;
1250  if (player->HasItemCount(ITEM_TEMPLAR_EARTH))
1251  result |= EARTH;
1252  if (player->HasItemCount(ITEM_TEMPLAR_AIR))
1253  result |= AIR;
1254  break;
1255  }
1256  case DUKE:
1257  {
1258  if (player->HasItemCount(ITEM_DUKE_FIRE))
1259  result |= FIRE;
1260  if (player->HasItemCount(ITEM_DUKE_WATER))
1261  result |= WATER;
1262  if (player->HasItemCount(ITEM_DUKE_EARTH))
1263  result |= EARTH;
1264  if (player->HasItemCount(ITEM_DUKE_AIR))
1265  result |= AIR;
1266  break;
1267  }
1268  case ROYAL:
1269  {
1270  if (player->HasItemCount(ITEM_ROYAL_FIRE))
1271  result |= FIRE;
1272  if (player->HasItemCount(ITEM_ROYAL_WATER))
1273  result |= WATER;
1274  if (player->HasItemCount(ITEM_ROYAL_EARTH))
1275  result |= EARTH;
1276  if (player->HasItemCount(ITEM_ROYAL_AIR))
1277  result |= AIR;
1278  break;
1279  }
1280  default:
1281  break;
1282  }
1283  return result;
1284  }
Definition: zone_silithus.cpp:1173
Definition: zone_silithus.cpp:1188
Definition: zone_silithus.cpp:1176
Definition: zone_silithus.cpp:1187
Definition: zone_silithus.cpp:1168
Definition: zone_silithus.cpp:1171
Definition: zone_silithus.cpp:1166
Definition: zone_silithus.cpp:1164
Definition: zone_silithus.cpp:1175
Definition: zone_silithus.cpp:1182
Definition: zone_silithus.cpp:1186
Definition: zone_silithus.cpp:1170
Definition: zone_silithus.cpp:1163
uint8_t uint8
Definition: Define.h:152
Definition: zone_silithus.cpp:1169
Definition: zone_silithus.cpp:1183
Definition: zone_silithus.cpp:1185
Definition: zone_silithus.cpp:1165
Definition: zone_silithus.cpp:1181
Definition: zone_silithus.cpp:1174
uint8 go_wind_stone::GetPlayerRank ( Player player)
inlineprivate
1223  {
1224  bool setAura = player->HasAura(AURA_TWILIGHT_SET);
1225  bool medallionAura = player->HasAura(AURA_MEDALLION);
1226  bool ringAura = player->HasAura(AURA_RING);
1227 
1228  if (setAura && medallionAura && ringAura)
1229  return 3;
1230  else if (setAura && medallionAura)
1231  return 2;
1232  else if (setAura)
1233  return 1;
1234  else
1235  return 0;
1236  }
Definition: zone_silithus.cpp:1115
Definition: zone_silithus.cpp:1113
Definition: zone_silithus.cpp:1114
bool go_wind_stone::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

1320  {
1321  uint8 rank = GetPlayerRank(player);
1322 
1323  uint32 gossipId = go->GetGOInfo()->GetGossipMenuId();
1324  switch (gossipId)
1325  {
1326  case GOSSIPID_LESSER_WS:
1327  {
1328  if (rank >= 1) // 1 or 2 or 3
1330  else
1331  {
1332  go->CastSpell(player, SPELL_PUNISHMENT);
1333  break;
1334  }
1335 
1336  uint8 item = GetItems(player, TEMPLAR);
1337  if (item & FIRE)
1339  if (item & WATER)
1341  if (item & EARTH)
1343  if (item & AIR)
1345  break;
1346  }
1347  case GOSSIPID_WS:
1348  {
1349  if (rank >= 2) // 2 or 3
1351  else
1352  {
1353  go->CastSpell(player, SPELL_PUNISHMENT);
1354  break;
1355  }
1356 
1357  uint8 item = GetItems(player, DUKE);
1358  if (item & FIRE)
1360  if (item & WATER)
1362  if (item & EARTH)
1364  if (item & AIR)
1366  break;
1367  }
1368  case GOSSIPID_GREATER_WS:
1369  {
1370  if (rank == 3) // 3
1372  else
1373  {
1374  go->CastSpell(player, SPELL_PUNISHMENT);
1375  break;
1376  }
1377 
1378  uint8 item = GetItems(player, ROYAL);
1379  if (item & FIRE)
1381  if (item & WATER)
1383  if (item & EARTH)
1385  if (item & AIR)
1387  break;
1388  }
1389  default:
1390  break;
1391  }
1392 
1393  player->SEND_GOSSIP_MENU(player->GetGossipTextId(gossipId, go), go->GetGUID());
1394  return true;
1395  }
#define GOSSIP_DUKE_FIRE
Definition: zone_silithus.cpp:1205
Definition: ScriptedGossip.h:71
Definition: zone_silithus.cpp:1188
Definition: zone_silithus.cpp:1187
#define GOSSIP_ROYAL_AIR
Definition: zone_silithus.cpp:1213
#define GOSSIP_ROYAL_FIRE
Definition: zone_silithus.cpp:1211
#define GOSSIP_DUKE_WATER
Definition: zone_silithus.cpp:1208
Definition: zone_silithus.cpp:1139
#define GOSSIP_TEMPLAR_FIRE
Definition: zone_silithus.cpp:1199
#define GOSSIP_DUKE_RANDOM
Definition: zone_silithus.cpp:1204
Definition: zone_silithus.cpp:1140
Definition: zone_silithus.cpp:1182
#define GOSSIP_DUKE_AIR
Definition: zone_silithus.cpp:1207
#define GOSSIP_TEMPLAR_WATER
Definition: zone_silithus.cpp:1202
uint32_t uint32
Definition: Define.h:150
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
void CastSpell(Unit *target, uint32 spell, bool triggered=true)
Definition: GameObject.cpp:1833
Definition: zone_silithus.cpp:1138
Definition: zone_silithus.cpp:1186
Definition: ScriptedGossip.h:73
uint32 GetGossipMenuId() const
Definition: GameObject.h:736
Definition: zone_silithus.cpp:1110
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_DUKE_EARTH
Definition: zone_silithus.cpp:1206
#define GOSSIP_ROYAL_RANDOM
Definition: zone_silithus.cpp:1210
Definition: GossipDef.h:59
uint8 GetItems(Player *player, WS type)
Definition: zone_silithus.cpp:1238
uint8 GetPlayerRank(Player *player)
Definition: zone_silithus.cpp:1222
#define GOSSIP_ROYAL_EARTH
Definition: zone_silithus.cpp:1212
uint8_t uint8
Definition: Define.h:152
#define GOSSIP_TEMPLAR_AIR
Definition: zone_silithus.cpp:1201
Definition: zone_silithus.cpp:1183
Definition: zone_silithus.cpp:1185
#define GOSSIP_TEMPLAR_RANDOM
Definition: zone_silithus.cpp:1198
#define GOSSIP_ROYAL_WATER
Definition: zone_silithus.cpp:1214
Definition: zone_silithus.cpp:1181
#define GOSSIP_TEMPLAR_EARTH
Definition: zone_silithus.cpp:1200

+ Here is the call graph for this function:

bool go_wind_stone::OnGossipSelect ( Player player,
GameObject go,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

1398  {
1399  player->PlayerTalkClass->ClearMenus();
1400  player->PlayerTalkClass->SendCloseGossip();
1401 
1402  switch (action)
1403  {
1404  case GOSSIP_ACTION_INFO_DEF + 1:
1406  break;
1407  case GOSSIP_ACTION_INFO_DEF + 2:
1409  break;
1410  case GOSSIP_ACTION_INFO_DEF + 3:
1412  break;
1413  case GOSSIP_ACTION_INFO_DEF + 4:
1415  break;
1416  case GOSSIP_ACTION_INFO_DEF + 5:
1418  break;
1419 
1420  case GOSSIP_ACTION_INFO_DEF + 6:
1422  break;
1423  case GOSSIP_ACTION_INFO_DEF + 7:
1424  SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE);
1425  break;
1426  case GOSSIP_ACTION_INFO_DEF + 8:
1428  break;
1429  case GOSSIP_ACTION_INFO_DEF + 9:
1431  break;
1432  case GOSSIP_ACTION_INFO_DEF + 10:
1433  SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR);
1434  break;
1435 
1436  case GOSSIP_ACTION_INFO_DEF + 11:
1438  break;
1439  case GOSSIP_ACTION_INFO_DEF + 12:
1441  break;
1442  case GOSSIP_ACTION_INFO_DEF + 13:
1444  break;
1445  case GOSSIP_ACTION_INFO_DEF + 14:
1447  break;
1448  case GOSSIP_ACTION_INFO_DEF + 15:
1449  SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR);
1450  break;
1451 
1452  default:
1453  break;
1454  }
1455  return true;
1456  }
Definition: zone_silithus.cpp:1125
Definition: zone_silithus.cpp:1133
Definition: zone_silithus.cpp:1155
Definition: zone_silithus.cpp:1152
Definition: zone_silithus.cpp:1130
Definition: ScriptedGossip.h:71
Definition: zone_silithus.cpp:1117
Definition: zone_silithus.cpp:1156
Definition: zone_silithus.cpp:1127
Definition: zone_silithus.cpp:1151
Definition: zone_silithus.cpp:1129
Definition: zone_silithus.cpp:1147
Definition: zone_silithus.cpp:1145
Definition: zone_silithus.cpp:1120
Definition: zone_silithus.cpp:1148
static First const & RAND(First const &first, Second const &second, Rest const &...rest)
Definition: CreatureAIImpl.h:30
Definition: zone_silithus.cpp:1146
Definition: zone_silithus.cpp:1153
Definition: zone_silithus.cpp:1131
Definition: zone_silithus.cpp:1121
Definition: zone_silithus.cpp:1132
Definition: zone_silithus.cpp:1157
Definition: zone_silithus.cpp:1124
Definition: zone_silithus.cpp:1150
Definition: zone_silithus.cpp:1158
Definition: zone_silithus.cpp:1119
Definition: zone_silithus.cpp:1118
Definition: zone_silithus.cpp:1126
void SummonNPC(GameObject *go, Player *player, uint32 npc, uint32 spell)
Definition: zone_silithus.cpp:1286
Definition: zone_silithus.cpp:1123

+ Here is the call graph for this function:

void go_wind_stone::SummonNPC ( GameObject go,
Player player,
uint32  npc,
uint32  spell 
)
inlineprivate
1287  {
1288  go->CastSpell(player, spell);
1289  TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - float(M_PI), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000);
1290  summons->CastSpell(summons, SPELL_SPAWN_IN, false);
1291  switch (summons->GetEntry())
1292  {
1293  case NPC_TEMPLAR_FIRE:
1294  case NPC_TEMPLAR_WATER:
1295  case NPC_TEMPLAR_AIR:
1296  case NPC_TEMPLAR_EARTH:
1297  summons->AI()->Talk(SAY_TEMPLAR_AGGRO);
1298  break;
1299 
1300  case NPC_DUKE_FIRE:
1301  case NPC_DUKE_WATER:
1302  case NPC_DUKE_EARTH:
1303  case NPC_DUKE_AIR:
1304  summons->AI()->Talk(SAY_DUKE_AGGRO);
1305  break;
1306  case NPC_ROYAL_FIRE:
1307  case NPC_ROYAL_AIR:
1308  case NPC_ROYAL_EARTH:
1309  case NPC_ROYAL_WATER:
1310  summons->AI()->Talk(YELL_ROYAL_AGGRO);
1311  break;
1312  }
1314  summons->SendMeleeAttackStart(player);
1315  summons->CombatStart(player);
1316  }
Definition: zone_silithus.cpp:1155
Definition: TemporarySummon.h:40
Definition: zone_silithus.cpp:1152
Definition: Unit.h:674
Definition: zone_silithus.cpp:1193
#define M_PI
Definition: Common.h:163
Definition: zone_silithus.cpp:1156
Definition: zone_silithus.cpp:1151
Definition: zone_silithus.cpp:1147
Definition: zone_silithus.cpp:1145
Definition: zone_silithus.cpp:1148
Definition: zone_silithus.cpp:1146
Definition: zone_silithus.cpp:1153
float GetPositionY() const
Definition: Position.h:105
CreatureAI * AI() const
Definition: Creature.h:525
float GetPositionZ() const
Definition: Position.h:106
Definition: zone_silithus.cpp:1157
void SendMeleeAttackStart(Unit *victim)
Definition: Unit.cpp:2134
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void CastSpell(Unit *target, uint32 spell, bool triggered=true)
Definition: GameObject.cpp:1833
Definition: zone_silithus.cpp:1195
Definition: zone_silithus.cpp:1150
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: zone_silithus.cpp:1158
Definition: UpdateFields.h:109
Definition: zone_silithus.cpp:1194
void CombatStart(Unit *target, bool initialAggro=true)
Definition: Unit.cpp:9862
uint32 GetEntry() const
Definition: Object.h:107
float GetPositionX() const
Definition: Position.h:104
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: zone_silithus.cpp:1111
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: Object.h:54

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: