void OnCombatStart(UnitPointer mTarget) { _unit->SendChatMessage( CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You wish to confront the master? You must weather the storm!"); spark_timer = 0; last_creation_hp = 100; RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME)); for( uint8 i=0; i<SPARKS_COUNT; i++) { CreatureProto *cp = CreatureProtoStorage.LookupEntry(28926); CreatureInfo *ci = CreatureNameStorage.LookupEntry(28926); CreaturePointer c = NULLCREATURE; if (cp && ci) { c = _unit->GetMapMgr()->CreateCreature( 28926 ); if (c) { c->Load(cp,_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation()); c->PushToWorld(_unit->GetMapMgr()); sparks[i] = c->GetGUID(); c->Root(); c->GetAIInterface()->disable_combat = true; for( uint8 i=0; i<7; i++ ) c->SchoolImmunityList[i] = 1; } } } }
void InnkeeperGossip::GossipSelectOption(ObjectPointer pObject, PlayerPointer Plr, uint32 Id, uint32 IntId, const char * Code) { CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE; if(pCreature==NULLCREATURE) return; switch(IntId) { case 1: // VENDOR Plr->GetSession()->SendInventoryList(pCreature); break; case 2: // BINDER Plr->GetSession()->SendInnkeeperBind(pCreature); break; case 3: // WHAT CAN I DO ? // Prepare second menu GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 1853, Plr); Menu->AddItem(5, "Make this inn your home.", 2); Menu->SendTo(Plr); break; case 4: // EVENT OF HALLOWEEN if(!Plr->HasAura(SPELL_TRICK_OR_TREATED)) { pCreature->CastSpell(Plr, SPELL_TRICK_OR_TREATED, true); // either trick or treat, 50% chance if(rand()%2) { Plr->CastSpell(Plr, SPELL_TREAT, true); } else { int32 trickspell=0; switch (rand()%9) { case 0: trickspell=24753; // cannot cast, random 30sec break; case 1: trickspell=24713; // lepper gnome costume break; case 2: if(Plr->getGender() == 0){ trickspell=24735; // male ghost costume }else{ trickspell=24736; // female ghostcostume } break; case 3: if(Plr->getGender() == 0){ trickspell=24711; // male ninja costume }else{ trickspell=24710; // female ninja costume } break; case 4: if(Plr->getGender() == 0){ trickspell=24708; // male pirate costume }else{ trickspell=24709; // female pirate costume } break; case 5: trickspell=24723; // skeleton costume break; } pCreature->CastSpell(Plr, trickspell, true); } } Plr->Gossip_Complete(); break; } }