|
|
Модератор форума: Dimitro |
Форум » TrinityCore » Патчи / Моды / Фиксы для Trinity » Beastmaster [2.4.3] (Oregon core) |
Beastmaster [2.4.3] |
Под ласт ревизию 2501+
1)Добавляем скрипт в scriptloader 2)Компилим 3)Создаем нпц госсипера и добавляем ему Scripname - npc_beastmaster Код #include "ScriptPCH.h" #include "Pet.h" #include "Formulas.h" #define GOSSIP_ITEM_STABLE "Стабильный" #define GOSSIP_ITEM_NEWPET "Новый петомец" #define GOSSIP_ITEM_BOAR "Бык" #define GOSSIP_ITEM_SERPENT "Змея" #define GOSSIP_ITEM_SCRAB "Скорпион" #define GOSSIP_ITEM_LION "Лев" #define GOSSIP_ITEM_WOLF "Волк" #define GOSSIP_ITEM_RAVAGER "пустошитель" #define GOSSIP_ITEM_MEDVED "Медвежонок" #define GOSSIP_ITEM_OBEZYANA "Обезьяна" #define GOSSIP_ITEM_CHEREPAHA "Черепашка" void CreatePet(Player *player, Creature * m_creature, uint32 entry) { if (player->GetPet()) { m_creature->Say("Вы должны сначала отпустить животное!", LANG_UNIVERSAL, 0); player->PlayerTalkClass->CloseGossip(); return; } Creature *creatureTarget = m_creature->SummonCreature(entry, player->GetPositionX(), player->GetPositionY() + 2, player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 500); if (!creatureTarget) return; Pet* pet = player->CreateTamedPetFrom(creatureTarget, 0); if (!pet) return; // kill original creature creatureTarget->setDeathState(JUST_DIED); creatureTarget->RemoveCorpse(); creatureTarget->SetHealth(0); // just for nice GM-mode view // 1500 training points, max happiness and loyalty pet->SetTP(1500); pet->SetPower(POWER_HAPPINESS, 1048000); pet->SetLoyaltyLevel(BEST_FRIEND); // prepare visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL, 70); pet->GetMap()->AddToMap((Creature*)pet); // visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL, 70); if (!pet->InitStatsForLevel(70)) error_log("Петомец создает не удачу: нет инициализации статистику для вступления %u", entry); pet->UpdateAllStats(); // caster have pet now player->SetMinion(pet, true); pet->SavePetToDB(PET_SAVE_AS_CURRENT); player->PetSpellInitialize(); //end player->PlayerTalkClass->CloseGossip(); } bool GossipHello_npc_beastmaster(Player *player, Creature *_Creature) { if (player->getClass() != CLASS_HUNTER) return true; player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_BOAR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_WOLF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_SERPENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_SCRAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_LION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_RAVAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_MEDVED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_OBEZYANA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_CHEREPAHA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); player->SEND_GOSSIP_MENU(100000, _Creature->GetGUID()); return true; } bool GossipSelect_npc_beastmaster(Player *player, Creature *_Creature, uint32 sender, uint32 action) { switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: //BOAR CreatePet(player, _Creature, 1192); break; case GOSSIP_ACTION_INFO_DEF + 2: //WOLF CreatePet(player, _Creature, 20058); break; case GOSSIP_ACTION_INFO_DEF + 3: //SERPENT CreatePet(player, _Creature, 20749); break; case GOSSIP_ACTION_INFO_DEF + 4: //SCORPID CreatePet(player, _Creature, 21864); break; case GOSSIP_ACTION_INFO_DEF + 5: //LION CreatePet(player, _Creature, 20671); break; case GOSSIP_ACTION_INFO_DEF + 6: //RAVAGER CreatePet(player, _Creature, 24922); break; case GOSSIP_ACTION_INFO_DEF + 7: //Медведь CreatePet(player, _Creature, 17345); break; case GOSSIP_ACTION_INFO_DEF + 8: //Обезьяна CreatePet(player, _Creature, 5260); break; case GOSSIP_ACTION_INFO_DEF + 9: //Черепашка CreatePet(player, _Creature, 4142); break; } return true; } void AddSC_npc_beastmaster() { Script *newscript; newscript = new Script; newscript->Name = "npc_beastmaster"; newscript->pGossipHello = &GossipHello_npc_beastmaster; newscript->pGossipSelect = &GossipSelect_npc_beastmaster; newscript->RegisterSelf(); } |
| |||
| |||