Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------------------------
- //------------------------ Gargajo - CREATURE_GOBBER ----------------------------------------------
- #define SAY_GARGAJO_F1 """\xc2\xa1""Yo machacarte!"
- #define SAY_GARGAJO_F2 """\xc2\xa1""Tu no gustarme!"
- #define SAY_GARGAJO_F3 """\xc2\xa1""Romper! ""\xc2\xa1""Machacar!"
- #define SAY_GARGAJO_F4 """\xc2\xa1""Te la has ganado!"
- #define SAY_GARGAJO_INTOV1 """\xc2\xa1""Genial!"
- #define SAY_GARGAJO_INTOV2 "Yo tambi""\xC3\xA9""n quiero conducir alguna vez..."
- #define SAY_AS_F1 """\xc2\xa1""Romperle las piernas!"
- #define SAY_AS_F2 """\xc2\xa1""D""\xC3\xB3""nde est""\xC3\xA1"" mi dinero!"
- #define SAY_AS_F3 """\xc2\xa1""Te voy a dar un le""\xc3\xb1""azo que te va a doler a ti y al de all""\xC3\xA1""!"
- #define SAY_AS_F4 """\xc2\xa1""Pero t""\xC3\xBA"" quien te crees que somos!"
- #define SAY_AS_INTOV1 """\xc2\xa1""Menudo buga m""\xC3\xA1""s guapo!"
- #define SAY_AS_INTOV2 """\xc2\xa1""Dale! ""\xc2\xa1""Dale!"
- #define SAY_AS_INTOV3 """\xc2\xa1""Vamos a llevarnos a todo el mundo por delante!"
- #define SAY_IZZY_F1 "Te has metido en una buena, cari""\xc3\xb1""o."
- #define SAY_IZZY_F2 """\xc2\xa1""Agarrarlo que yo le atizo!"
- #define SAY_IZZY_F3 """\xc2\xa1""Oghhh! Pero mira que eres feo."
- #define SAY_IZZY_F4 "Pobre. Te librar""\xC3\xA9"" de tu sufrimiento... o no..."
- #define SAY_IZZY_INTOV1 """\xc2\xa1""Soy toda tuya!"
- #define SAY_IZZY_INTOV2 """\xc2\xa1""Vamos a atropellar cabezas!"
- class npc_trio_calatraba : public CreatureScript
- {
- public:
- npc_trio_calatraba() : CreatureScript("npc_trio_calatraba") { }
- struct npc_trio_calatrabaAI : public ScriptedAI
- {
- npc_trio_calatrabaAI(Creature* creature) : ScriptedAI(creature) {}
- bool castOrNor;
- bool restored;
- bool AggrOrNot;
- uint32 timermo;
- uint32 pasivePHReg;
- uint32 Entry;
- uint32 Ontimex;
- void Reset()
- {
- timermo = urand(3000, 5000);
- castOrNor = true;
- pasivePHReg = 3000;
- Entry = me->GetEntry();
- Unit* owner = me->GetOwner();
- if (owner)
- me->InitCharmInfo();
- if(Ontimex != 3)
- OneTime();
- }
- void OneTime()
- {
- restored = false;
- AggrOrNot = false;
- Ontimex = 3;
- }
- void MoveInLineOfSight(Unit* who)
- {
- Unit* owner = me->GetOwner();
- if (owner)
- return;
- if (who->GetTypeId() != TYPEID_PLAYER && who->GetEntry() != CREATURE_VEHICLE_BOLIDO)
- return;
- if(who->GetEntry() == CREATURE_VEHICLE_BOLIDO)
- {
- if(Vehicle* vh = who->GetVehicleKit())
- if(Unit* Sdo = vh->GetPassenger(0))
- if(Sdo->GetTypeId() == TYPEID_PLAYER)
- {
- who = Sdo;
- }
- else return;
- else return;
- }
- castOrNor = true;
- //QUEST_VOY_EN_UN_COCHE
- if(who->GetTypeId() == TYPEID_PLAYER && who->IsInWorld())
- {
- if(me->GetDistance2d(who) < 11.0f && ((Player*)who)->GetQuestStatus(QUEST_VOY_EN_UN_COCHE) == QUEST_STATUS_INCOMPLETE)
- {
- Unit* chr = who->GetCharm();
- std::list<Creature*> StdList;
- me->GetCreatureListWithEntryInGrid(StdList, Entry, 40.0f);
- for (std::list<Creature*>::const_iterator itr = StdList.begin(); itr != StdList.end(); ++itr)
- {
- if(StdList.empty())
- castOrNor = true;
- else
- {
- Unit* crOwner = (*itr)->GetOwner();
- if(!crOwner)
- continue;
- else if (crOwner = who)
- castOrNor = false;
- }
- }
- ((Player*)who)->KilledMonsterCredit(Entry, 0);
- if(castOrNor)
- {
- if(Entry == CREATURE_GOBBER) //Gordi
- who->CastSpell(who,GOBBER_INVO,true);
- if(Entry == CREATURE_ACE) //As
- who->CastSpell(who,ACE_INVO,true);
- if(Entry == CREATURE_IZZY) //Izzy
- who->CastSpell(who,IZZY_INVO,true);
- me->DespawnOrUnsummon();
- me->SetRespawnDelay(7);
- me->SetRespawnTime(6);
- // me->Respawn();
- }
- else return;
- }
- }}
- void EnterCombat(Unit* /*who*/)
- {
- if(me->GetReactState() == REACT_PASSIVE || me->GetReactState() == REACT_PASSIVE)
- return;
- if(Entry == CREATURE_GOBBER) //Gordi
- {
- switch (rand() % 7)
- {
- case 0: me->MonsterSay(SAY_GARGAJO_F1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_GARGAJO_F2, LANG_UNIVERSAL, 0); break;
- case 2: me->MonsterSay(SAY_GARGAJO_F3, LANG_UNIVERSAL, 0); break;
- case 3: me->MonsterSay(SAY_GARGAJO_F4, LANG_UNIVERSAL, 0); break;
- case 4: case 5: case 6: break;
- }
- }
- if(Entry == CREATURE_ACE) //As
- {
- switch (rand() % 7)
- {
- case 0: me->MonsterSay(SAY_AS_F1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_AS_F2, LANG_UNIVERSAL, 0); break;
- case 2: me->MonsterSay(SAY_AS_F3, LANG_UNIVERSAL, 0); break;
- case 3: me->MonsterSay(SAY_AS_F4, LANG_UNIVERSAL, 0); break;
- case 4: case 5: case 6: break;
- }
- }
- if(Entry == CREATURE_IZZY) //Izzy
- {
- switch (rand() % 7)
- {
- case 0: me->MonsterSay(SAY_IZZY_F1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_IZZY_F2, LANG_UNIVERSAL, 0); break;
- case 2: me->MonsterSay(SAY_IZZY_F3, LANG_UNIVERSAL, 0); break;
- case 3: me->MonsterSay(SAY_IZZY_F4, LANG_UNIVERSAL, 0); break;
- case 4: case 5: case 6: break;
- }
- }
- }
- void UpdateAI(uint32 diff)
- {
- Unit* owner = me->GetOwner();
- if (!owner)
- return;
- if(restored && me->GetDistance2d(owner) < 6.0f)
- AggrOrNot = false;
- if(me->GetDistance2d(owner) > 15.0f && AggrOrNot && !UpdateVictim())
- {
- if(me->GetCharmInfo())
- {
- me->GetCharmInfo()->RestoreState();
- AggrOrNot = false;
- }
- }
- if (UpdateVictim())
- {
- if(me->GetDistance2d(owner) > 35.0f)
- {
- me->GetVictim()->DeleteThreatList();
- me->GetVictim()->CombatStop(true);
- me->GetCharmInfo()->RestoreState();
- me->SetReactState(REACT_PASSIVE);
- restored = true;
- }
- DoMeleeAttackIfReady();
- }
- if (owner->GetTypeId() != TYPEID_PLAYER)
- return;
- if(!AggrOrNot && !owner->GetVehicleBase() && !me->GetVehicleBase())
- {
- me->SetReactState(REACT_AGGRESSIVE);
- AggrOrNot = true;
- }
- //IsOnVehicle
- if(owner->GetVehicleBase() && owner->GetVehicleBase()->GetEntry() == CREATURE_VEHICLE_BOLIDO && !me->GetVehicleBase())
- {
- me->SetReactState(REACT_PASSIVE);
- AggrOrNot = false;
- if(Entry == CREATURE_GOBBER) //Gordi
- {
- switch (rand() % 5){
- case 0: me->MonsterSay(SAY_GARGAJO_INTOV1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_GARGAJO_INTOV2, LANG_UNIVERSAL, 0); break;
- case 2: case 3: case 4: break;
- }
- Unit* moto = owner->GetVehicleBase();
- if(moto && !moto->GetVehicleKit()->GetPassenger(2))
- me->EnterVehicle(moto,2);
- }
- if(Entry == CREATURE_ACE) //As
- {
- switch (rand() % 6)
- {
- case 0: me->MonsterSay(SAY_AS_INTOV1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_AS_INTOV2, LANG_UNIVERSAL, 0); break;
- case 2: me->MonsterSay(SAY_AS_INTOV2, LANG_UNIVERSAL, 0); break;
- case 3: case 4: case 5: break;
- }
- Unit* moto = owner->GetVehicleBase();
- if(moto && !moto->GetVehicleKit()->GetPassenger(1))
- me->EnterVehicle(moto,1);
- }
- if(Entry == CREATURE_IZZY) //Izzy
- {
- switch (rand() % 3)
- {
- case 0: me->MonsterSay(SAY_IZZY_INTOV1, LANG_UNIVERSAL, 0); break;
- case 1: me->MonsterSay(SAY_IZZY_INTOV2, LANG_UNIVERSAL, 0); break;
- case 2: case 3: case 4: break;
- }
- Unit* moto = owner->GetVehicleBase();
- if(moto && !moto->GetVehicleKit()->GetPassenger(3))
- me->EnterVehicle(moto,3);
- }
- }
- // Cada tres segudos regenerará un % de vida.
- if (pasivePHReg <= diff)
- {
- me->SetHealth(me->GetHealth() + me->GetMaxHealth()/10);
- pasivePHReg = 8000;
- } else pasivePHReg -= diff;
- //Si está en un vehículo
- if(me->GetVehicleBase())
- {
- if (timermo <= diff)
- {
- if(Entry == CREATURE_GOBBER) //Gordi
- {
- switch (rand() % 4)
- {
- case 0: me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); me->PlayDistanceSound(6943); break;
- case 1: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); break;
- case 2: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- case 3: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- }
- }
- if(Entry == CREATURE_ACE) //As 23330
- {
- switch (rand() % 4)
- {
- case 0: me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);me->PlayDistanceSound(23330); break;
- case 1: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); break;
- case 2: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- case 3: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- }
- }
- if(Entry == CREATURE_IZZY)
- {
- switch (rand() % 4)
- {
- case 0: me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);me->PlayDistanceSound(19248); break;
- case 1: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); break;
- case 2: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- case 3: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); break;
- }
- }
- timermo = urand(3000,7000);
- } else timermo -= diff;
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_trio_calatrabaAI(creature);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement