T端 GameObject上的T端魔兽私服传送脚本

1、实现魔兽中简单的Gameobeject传送。主要是方便初学者参考使用! 2、与上一篇不同的是。这篇主要是在Gameobeject上实现传送,而不是NPC上。。 例如:你需要在gameobject_template表中找一些模型ID。然后在scriptname这一列中增加脚本名称,本例的脚本名称是“gob_teleport” 比如选一些游戏目标来增加脚本。打开gameobject_template表,选一些物件:祖尔法拉克铁锣,拉瑟莱克之泪,阿尔萨斯之泪, 伊姆贝尔之焰,瑟玛普拉格的保险箱等等这些上面 3、然后重新启动服务端(前提是编译好本脚本的服务端哦!) 4、进入游戏。用gm命令,把你加了脚本的gameobejcet_template里面的游戏目标加到游戏中!! 好,不多说了。看看下面的代码 /* Made by: aaddss A.K.A Deathsoul untested (in game) */ #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "Spell.h" #include "Player.h" class gob_teleport : public GameObjectScript { public: gob_teleport() : GameObjectScript("gob_teleport") { } bool OnGossipHello(Player * player, GameObject * go) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport name here", GOSSIP_SENDER_MAIN, 1); return true; } bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction) { if(!Player) return true; switch(uiAction) { case 1: Player->TeleportTo(0, 11.00f, 12.00f, 13.00f, 123.00f); // please change the map id , x , z , y , o (or it will not teleport where u want return true; } } }; void AddSc_gob_teleport() { new gob_teleport(); }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzyszj.html