Advertisement
Guest User

Easy Mounts

a guest
May 13th, 2010
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.60 KB | None | 0 0
  1. /* WORLD
  2. DELETE FROM `creature_template` WHERE `entry` = '470101';
  3.  
  4. REPLACE INTO `creature_template` (`entry`, `difficulty_entry_1`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `minlevel`, `maxlevel`, `armor_mod`, `faction_A`, `faction_H`, `npcflag`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `health_mod`, `mana_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`) VALUES
  5. (470101, 0, 0, 0, 15609, 0, 15609, 0, 'Mounts', '', NULL, 82, 82,  1, 35, 35, 1, 1, 1000, 1500, 0, 1000, 1, 1500, 1500, 1, 2, 0, 0, 0, 0, 0, 0, 30, 45, 100, 7, 8, 0, 0, 0, 100, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, 1500, 1700, '', 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'npc_mount');
  6.  
  7. DELETE FROM `locales_creature` WHERE `entry` = '470101';
  8.  
  9. REPLACE INTO `locales_creature` (`entry`, `name_loc8`, `subname_loc8`) VALUES
  10. (470101, 'Прокат маунтов', '');
  11. */
  12. #include "ScriptedPch.h"
  13.  
  14. #define MSG_GOSSIP_TEXT_1               "Я бы хотел взять на прокат быстрое средство передвижения за 10 медных монет"
  15. #define MSG_GOSSIP_TEXT_2               "Я бы хотел взять на прокат очень быстрое средство передвижения за 1 серебряную"
  16. #define MSG_NOT_MONEY                   "У вас не достаточно денег..."
  17. #define MSG_MOUTED                      "Вы уже на средстве передвижения."
  18. #define COST_MONEY_1                    10
  19. #define COST_MONEY_2                    100
  20. #define MOUNT_SPELL_ID_1                43899
  21. #define MOUNT_SPELL_ID_2                43900
  22.  
  23. bool GossipHello_npc_mount(Player *player, Creature *_creature)
  24. {
  25.     player->ADD_GOSSIP_ITEM(0, MSG_GOSSIP_TEXT_1, GOSSIP_SENDER_MAIN, 1001);
  26.     player->ADD_GOSSIP_ITEM(0, MSG_GOSSIP_TEXT_2, GOSSIP_SENDER_MAIN, 1002);
  27.     player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  28.     return true;
  29. }
  30.  
  31. bool GossipSelect_npc_mount(Player *player, Creature *_creature, uint32 sender, uint32 action )
  32. {
  33.     if (sender != GOSSIP_SENDER_MAIN)
  34.         return false;
  35.  
  36.     if (player->IsMounted()){
  37.         _creature->MonsterWhisper(MSG_MOUTED, player->GetGUID());
  38.         return false;
  39.     }
  40.  
  41.     switch (action)
  42.     {
  43.         case 1001:
  44.             if (player->GetMoney() < COST_MONEY_1)
  45.             {
  46.                 _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID());
  47.             }else{
  48.                 player->AddAura(MOUNT_SPELL_ID_1,   player);
  49.                 player->ModifyMoney(-COST_MONEY_1);
  50.             }
  51.             break;
  52.         case 1002:
  53.             if (player->GetMoney() < COST_MONEY_2)
  54.             {
  55.                 _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID());
  56.             }else{
  57.                 player->AddAura(MOUNT_SPELL_ID_2,   player);
  58.                 player->ModifyMoney(-COST_MONEY_2);
  59.             }
  60.             break;
  61.     }
  62.     return true;
  63. }
  64.  
  65.  
  66. void AddSC_npc_mount()
  67. {
  68.     Script *newscript;
  69.     newscript = new Script;
  70.     newscript->Name = "npc_mount";
  71.     newscript->pGossipHello = &GossipHello_npc_mount;
  72.     newscript->pGossipSelect = &GossipSelect_npc_mount;
  73.     newscript->RegisterSelf();
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement