关灯
开启左侧

WOWSF模拟器M服务端(TBC)给玩家飞行BUFF的脚本

  [复制链接]
admin实名认证 发表于 2016-4-20 23:02:00 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
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();
+}


回复下载完整代码


游客,如果您要查看本帖隐藏内容请回复


 

精彩评论1

倒序浏览
ebter 发表于 2019-7-23 08:57:05 | 显示全部楼层
 
厉害了我的哥
 
VIP介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

5粉丝

3421帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地