Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* WORLD
- DELETE FROM `creature_template` WHERE `entry` = '470101';
- 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
- (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');
- DELETE FROM `locales_creature` WHERE `entry` = '470101';
- REPLACE INTO `locales_creature` (`entry`, `name_loc8`, `subname_loc8`) VALUES
- (470101, 'Прокат маунтов', '');
- */
- #include "ScriptedPch.h"
- #define MSG_GOSSIP_TEXT_1 "Я бы хотел взять на прокат быстрое средство передвижения за 10 медных монет"
- #define MSG_GOSSIP_TEXT_2 "Я бы хотел взять на прокат очень быстрое средство передвижения за 1 серебряную"
- #define MSG_NOT_MONEY "У вас не достаточно денег..."
- #define MSG_MOUTED "Вы уже на средстве передвижения."
- #define COST_MONEY_1 10
- #define COST_MONEY_2 100
- #define MOUNT_SPELL_ID_1 43899
- #define MOUNT_SPELL_ID_2 43900
- bool GossipHello_npc_mount(Player *player, Creature *_creature)
- {
- player->ADD_GOSSIP_ITEM(0, MSG_GOSSIP_TEXT_1, GOSSIP_SENDER_MAIN, 1001);
- player->ADD_GOSSIP_ITEM(0, MSG_GOSSIP_TEXT_2, GOSSIP_SENDER_MAIN, 1002);
- player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
- return true;
- }
- bool GossipSelect_npc_mount(Player *player, Creature *_creature, uint32 sender, uint32 action )
- {
- if (sender != GOSSIP_SENDER_MAIN)
- return false;
- if (player->IsMounted()){
- _creature->MonsterWhisper(MSG_MOUTED, player->GetGUID());
- return false;
- }
- switch (action)
- {
- case 1001:
- if (player->GetMoney() < COST_MONEY_1)
- {
- _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID());
- }else{
- player->AddAura(MOUNT_SPELL_ID_1, player);
- player->ModifyMoney(-COST_MONEY_1);
- }
- break;
- case 1002:
- if (player->GetMoney() < COST_MONEY_2)
- {
- _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID());
- }else{
- player->AddAura(MOUNT_SPELL_ID_2, player);
- player->ModifyMoney(-COST_MONEY_2);
- }
- break;
- }
- return true;
- }
- void AddSC_npc_mount()
- {
- Script *newscript;
- newscript = new Script;
- newscript->Name = "npc_mount";
- newscript->pGossipHello = &GossipHello_npc_mount;
- newscript->pGossipSelect = &GossipSelect_npc_mount;
- newscript->RegisterSelf();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement