当前位置:首页>>魔兽单机>>正文
单机M服务端(TBC)给玩家飞行BUFF的脚本
2013-03-31 16:19:30 作者:fiver 来源: 浏览次数:0
摘要:单机M服务端(TBC)给玩家飞行BUFF的脚本
 diff -Nuar oregoncore-current/src/game/ScriptLoader.cpp oregoncore-pq/src/game/ScriptLoader.cpp
--- oregoncore-current/src/game/ScriptLoader.cpp 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/ScriptLoader.cpp 2011-01-01 10:21:05.000000000 -0500
@@ -11,6 +11,9 @@
 
 #ifdef SCRIPTS
 
+//custom
+void AddSC_npc_rentalmount();
+
 //examples
 //void AddSC_custom_example();
 //void AddSC_custom_gossip_codebox();
@@ -379,6 +382,10 @@
 void AddScripts()
 {
 #ifdef SCRIPTS
+
+    //Custom
+    AddSC_npc_rentalmount();
+
 //    AddSC_custom_example();
 //    AddSC_custom_gossip_codebox();
 //    AddSC_test();
diff -Nuar oregoncore-current/src/oregoncore/oregoncore.conf.dist oregoncore-pq/src/oregoncore/oregoncore.conf.dist
--- oregoncore-current/src/oregoncore/oregoncore.conf.dist 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/oregoncore/oregoncore.conf.dist 2011-01-01 10:21:05.000000000 -0500
@@ -1891,6 +1891,14 @@
 ###############################################################################
 # CUSTOM SERVER OPTIONS
 #
+#    RentalMountNPC.SlowPrice
+#        Price in copper for regular mount.
+#        Default: 100 (1 silver)
+#
+#    RentalMountNPC.FastPrice
+#        Price in copper for swift mount.
+#        Default: 500 (5 silver)
+#
 #    PlayerStart.AllReputation
 #        Players will start with most of the high level reputations that are
 #         needed for items, mounts etc.
@@ -1983,6 +1991,8 @@
 #
 ###############################################################################
 
+RentalMountNPC.SlowPrice = 100
+RentalMountNPC.FastPrice = 500
 PlayerStart.AllReputation = 0
 PlayerStart.AllSpells = 0
 PlayerStart.MapsExplored = 0
diff -Nuar oregoncore-current/src/scripts/Custom/npc_rentalmount.cpp oregoncore-pq/src/scripts/Custom/npc_rentalmount.cpp
--- oregoncore-current/src/scripts/Custom/npc_rentalmount.cpp 1969-12-31 19:00:00.000000000 -0500
+++ oregoncore-pq/src/scripts/Custom/npc_rentalmount.cpp 2011-01-01 10:21:05.000000000 -0500
@@ -0,0 +1,65 @@
+#include "ScriptPCH.h" 
+#include "Config/Config.h"
+
+#define MSG_GOSSIP_TEXT_1  "I would like to rent a mount." 
+#define MSG_GOSSIP_TEXT_2  "I would like to rent a very fast mount." 
+#define MSG_NOT_MONEY      "You do not have enough money." 
+#define MSG_MOUTED         "You already have a mount." 
+#define MOUNT_SPELL_ID_1   43899 
+#define MOUNT_SPELL_ID_2   43900 
+
+bool GossipHello_npc_rentalmount(Player *player, Creature *_creature) 
+{ 
+    player->ADD_GOSSIP_ITEM(4, MSG_GOSSIP_TEXT_1, GOSSIP_SENDER_MAIN, 1001); 
+    player->ADD_GOSSIP_ITEM(4, MSG_GOSSIP_TEXT_2, GOSSIP_SENDER_MAIN, 1002); 
+    player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID()); 
+    return true; 
+} 
+
+bool GossipSelect_npc_rentalmount(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; 
+    } 
+
+    uint32 slowprice = sConfig.GetIntDefault("RentalMountNPC.SlowPrice",100);
+    uint32 fastprice = sConfig.GetIntDefault("RentalMountNPC.FastPrice",500);
+
+    switch (action) 
+    { 
+    case 1001: 
+        if (player->GetMoney() < slowprice) 
+        { 
+            _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID()); 
+        } else { 
+            player->AddAura(MOUNT_SPELL_ID_1,    player); 
+            player->ModifyMoney(-slowprice); 
+        } 
+        break; 
+    case 1002: 
+        if (player->GetMoney() < fastprice) 
+        { 
+            _creature->MonsterWhisper(MSG_NOT_MONEY, player->GetGUID()); 
+        } else { 
+            player->AddAura(MOUNT_SPELL_ID_2,    player); 
+            player->ModifyMoney(-fastprice); 
+        } 
+        break; 
+    } 
+    player->CLOSE_GOSSIP_MENU();
+    return true; 
+} 
+
+void AddSC_npc_rentalmount() 
+{ 
+     Script *newscript; 
+     newscript = new Script; 
+     newscript->Name = "npc_rentalmount"; 
+     newscript->pGossipHello = &GossipHello_npc_rentalmount; 
+     newscript->pGossipSelect = &GossipSelect_npc_rentalmount; 
+     newscript->RegisterSelf(); 
 


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度