随笔 - 298  文章 - 377  trackbacks - 0
<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(34)

随笔分类

随笔档案

文章档案

相册

收藏夹

搜索

  •  

最新评论

阅读排行榜

评论排行榜

#include "StdAfx.h"
#include 
"Setup.h"


class SCRIPT_DECL TeleportNPC : public GossipScript
{
public:
    ADD_GOSSIP_FACTORY_FUNCTION(TeleportNPC);
    
void GossipHello(Creature * pCreature, Player * Plr, bool AutoSend)
    {
        GossipMenu 
*Menu;
        objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);

        Menu
->AddItem(5" 把这里设置成回城点 "98);
        
if (Plr->GetTeam() > 0
        { Menu
->AddItem(0" 部落主城传送 "1); } 
        
else
        { Menu
->AddItem(0" 联盟主城传送 "2); }
        Menu
->AddItem(0" 外域传送 "3);

        Menu
->AddItem(0" 主城传送 ",100);//100 开我加的
        Menu->AddItem(0" 初级副本传送 ",101);
        Menu
->AddItem(0" 中级副本传送 ",102);
        Menu
->AddItem(0" 团队副本传送 ",103);
        Menu
->AddItem(0" 外域副本传送1 ",104);
        Menu
->AddItem(0" 外域副本传送2 ",     105);
        Menu
->AddItem(0" 个人银行 ",          106);
        Menu
->AddItem(0" 开通飞行点 ",        107);
        Menu
->AddItem(0" 领取工资 ",  108);
        Menu
->AddItem(0" 外域传送 ",      109);
        Menu
->AddItem(0" 野外BOSS传送 "110);

        
if(AutoSend)
            Menu
->SendTo(Plr);
    }

    
void GossipSelectOption(Creature* pCreature, Player* Plr, uint32 Id, uint32 IntId)
    {
        GossipMenu 
* Menu;
        
switch(IntId)
        {
        
case 0:     // Return to start
                GossipHello(pCreature, Plr, true);
            
break;

        
case 98:     // BINDER
                Plr->GetSession()->SendInnkeeperBind(pCreature);
            
break;

        
case 1:     // Horde
                objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 部落 银月城 "4);
                Menu
->AddItem(5" 部落 奥格瑞玛 "5);
                Menu
->AddItem(5" 部落 雷霆崖 "6);
                Menu
->AddItem(5" 部落 幽暗城 "7);
                Menu
->AddItem(0"[返回]"99);


                Menu
->SendTo(Plr);
            
break;

        
case 2:     // Alliance
                objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 联盟 埃索达 "8);
                Menu
->AddItem(5" 联盟 暴风城 "9);
                Menu
->AddItem(5" 联盟 铁炉堡 "10);
                Menu
->AddItem(5" 联盟 达纳苏斯 "11);
                Menu
->AddItem(0"[返回]"99);
                Menu
->SendTo(Plr);
            
break;

        
case 3:     // Outland
            if(Plr->getLevel() < 60)
            {
                pCreature
->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL," 你还没有资格进入(等级限制60). ");
                Plr
->Gossip_Complete();
            }
else{
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 黑暗之门 "12);
                Menu
->AddItem(5" 赞加沼泽 "13);
                Menu
->AddItem(5" 纳格兰 "14);
                Menu
->AddItem(5" 刀锋山 "15);
                Menu
->AddItem(5" 虚空风暴 "16);
                Menu
->AddItem(5" 泰罗卡森林 "17);
                Menu
->AddItem(5" 影月谷 "18);
                Menu
->AddItem(0"[返回]"99);
                Menu
->SendTo(Plr);
            }
            
break;

            
//////////////////
            // Horde submenu
            ////////

        
case 4://Silvermoon
            {
                Plr
->EventTeleport(5309400.486328-7278.37695314.206780);

            }
break;

        
case 5://Orgrimmar
            {
                Plr
->EventTeleport(11371.068970-4370.80175826.052483);
            }
break;

        
case 6://ThunderBluff
            {
                Plr
->EventTeleport(1-1304.569946205.28500468.681396);
            }
break;

        
case 7://UnderCity
            {
                Plr
->EventTeleport(02050.203125285.65060456.994549);
            }
break;

            
////////////////
            // Alliance Menu
            ////////

        
case 8//Exodar
            {
                Plr
->EventTeleport(530-4072.202393-12014.337891-1.277277);
            }
break;

        
case 9//Stormwind
            {
                Plr
->EventTeleport(0-9100.480469406.95074592.594185);
            }
break;

        
case 10//Ironforge
            {
                Plr
->EventTeleport(0-5028.265137-825.976563495.301575);
            }
break;

        
case 11//Darnassus
            {
                Plr
->EventTeleport(19985.9072271971.1556401326.815674);
            }
break;

            
////////////////
            // Outland Menu
            ////////

        
case 12//Hellfire Peninsula
            {
                Plr
->EventTeleport(530-248.160004922.34899984.379799);
            }
break;

        
case 13//Zangermarsh
            {
                Plr
->EventTeleport(530-225.8636325405.92724622.346397);
            }
break;

        
case 14//Nagrand
            {
                Plr
->EventTeleport(530-468.2323308418.66601628.031298);

            }
break;

        
case 15//Blades Edge Mountains
            {
                Plr
->EventTeleport(5301471.6728526828.047852107.759239);

            }
break;

        
case 16//Netherstorm
            {
                Plr
->EventTeleport(5303396.1237794182.208008137.097992);

            }
break;

        
case 17//Terokkar Forest
            {
                Plr
->EventTeleport(530-1202.4266365313.69287133.774723);

            }
break;

        
case 18//Shadowmoon Valley
            {
                Plr
->EventTeleport(530-2859.5224613182.3477310.008426);

            }
break;
        
case 99//main menu
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);

                Menu
->AddItem(5" 把这里设置成回城点 "98);
                
if (Plr->GetTeam() > 0
                { Menu
->AddItem(0" 部落主城传送 "1); } 
                
else
                { Menu
->AddItem(0" 联盟主城传送 "2); }
                Menu
->AddItem(0" 外域传送 "3);
                Menu
->AddItem(0" 主城传送 ",100);//100 开我加的
                Menu->AddItem(0" 初级副本传送 ",101);
                Menu
->AddItem(0" 中级副本传送 ",102);
                Menu
->AddItem(0" 团队副本传送 ",103);
                Menu
->AddItem(0" 外域副本传送1 ",104);
                Menu
->AddItem(0" 外域副本传送2 ",     105);
                Menu
->AddItem(0" 个人银行 ",          106);
                Menu
->AddItem(0" 开通飞行点 ",        107);
                Menu
->AddItem(0" 领取工资 ",  108);
                Menu
->AddItem(0" 外域传送 ",      109);
                Menu
->AddItem(0" 野外BOSS传送 "110);
                Menu
->SendTo(Plr);
            }
break;
        
case 100://主城传送
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 联盟 暴风城 ",        1001); 
                Menu
->AddItem(5" 联盟 铁炉堡 ",         1002); 
                Menu
->AddItem(5" 联盟 达纳苏斯 ",    1003); 
                Menu
->AddItem(5" 联盟 埃索达 ",         1004); 
                Menu
->AddItem(5" 部落 奥格瑞玛 ",    1005); 
                Menu
->AddItem(5" 部落 雷霆崖 ",        1006); 
                Menu
->AddItem(5" 部落 幽暗城 ",        1007); 
                Menu
->AddItem(5" 部落 银月城 ",        1008); 
                Menu
->AddItem(5" 中立 棘齿城 ",      1009); 
                Menu
->AddItem(5" 中立 藏宝海湾 ",    10010); 
                Menu
->AddItem(5" 中立 加基森 ",      10011); 
                Menu
->AddItem(5" 中立 塞纳里奥要塞 ",10012);
                Menu
->AddItem(0"[返回]",              99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1001://联盟 暴风城 
            {
                Plr
->EventTeleport(0,-9065,434,94);
            }
break;
        
case 1002://联盟 铁炉堡
            {
                Plr
->EventTeleport(0,-5032,-819,495);
            }
break;
        
case 1003://联盟 达纳苏斯
            {
                Plr
->EventTeleport(1,9961,2055,1329);
            }
break;
        
case 1004://联盟 埃索达
            {
                Plr
->EventTeleport(530,-4071.7,-12036.7,-1.5);
            }
break;
        
case 1005://部落 奥格瑞玛
            {
                Plr
->EventTeleport(1,1317,-4383,27);
            }
break;
        
case 1006://部落 雷霆崖
            {
                Plr
->EventTeleport(1,-1391,140,23);
            }
break;
        
case 1007://部落 幽暗城
            {
                Plr
->EventTeleport(0,1909,235,53);
            }
break;
        
case 1008://部落 银月城
            {
                Plr
->EventTeleport(530,9336.9,-7278.4,13.6);
            }
break;
        
case 1009://中立 棘齿城
            {
                Plr
->EventTeleport(1,-977,-3788,6);
            }
break;
        
case 10010://中立 藏宝海湾
            {
                Plr
->EventTeleport(0,-14302,518,9);
            }
break;
        
case 10011://中立 加基森
            {
                Plr
->EventTeleport(1,-7103.7,-2961.6,10.8);
            }
break;
        
case 10012://中立 塞纳里奥要塞
            {
                Plr
->EventTeleport(1,-6831.1,748.8,42.5);
            }
break;
        
case 101://初级副本传送
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" [14] 怒焰裂谷 ",   1011); 
                Menu
->AddItem(5" [19] 死亡矿井 ",   1012); 
                Menu
->AddItem(5" [22] 哀嚎洞穴 ",   1013); 
                Menu
->AddItem(5" [24] 影牙城堡 ",   1014); 
                Menu
->AddItem(5" [26] 黑暗深渊 ",     1015); 
                Menu
->AddItem(5" [27] 暴风城监狱 "1016); 
                Menu
->AddItem(5" [31] 剃刀沼泽 ",   1017); 
                Menu
->AddItem(5" [33] 诺莫瑞根 ",   1018); 
                Menu
->AddItem(5" [40] 血色修道院 "1019); 
                Menu
->AddItem(5" [42] 剃刀高地 ",   10110); 
                Menu
->AddItem(5" [45] 奥达曼 ",     10111);
                Menu
->AddItem(0"[返回]",               99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1011://初级副本传送[14] 怒焰裂谷 
            {
                
//Plr->EventTeleport(389,2.024650,-10.021000,-16.187500);
                /*
                //Map *pMap = sWorldCreator.GetMap(389);
                //MapMgr *pMapMgr = pMap->CreateMapMgrInstance();
                //sLog.outString("Instance %u on map %u created.", pMapMgr->GetInstanceID(), pMapMgr->GetMapId());
                //Plr->SafeTeleport(389,pMapMgr->GetInstanceID(),LocationVector(2.024650,-10.021000,-16.187500));
                
*/
                Teleport(Plr,
389,2.024650,-10.021000,-16.187500,0);
            }
break;
        
case 1012://初级副本传送[19] 死亡矿井 
            {
                
//Plr->EventTeleport(36,-16.4,-383.07,61.78);
                /*
                Map *pMap = sWorldCreator.GetMap(36);
                MapMgr *pMapMgr = pMap->CreateMapMgrInstance();
                sLog.outString("Instance %u on map %u created.", pMapMgr->GetInstanceID(), pMapMgr->GetMapId());
                Plr->SafeTeleport(36,pMapMgr->GetInstanceID(),LocationVector(-16.4,-383.07,61.78));
                
*/
                Teleport(Plr,
36,-16.4,-383.07,61.78,0);
            }
break;
        
case 1013://初级副本传送[22] 哀嚎洞穴 
            {
                
//Plr->EventTeleport(43,-161.841995,133.266998,-73.866203);
                Teleport(Plr,43,-161.841995,133.266998,-73.866203,0);
            }
break;
        
case 1014://初级副本传送[24] 影牙城堡
            {
                
//Plr->EventTeleport(33,-228.19,2110.56,76.89);
                Teleport(Plr,33,-228.19,2110.56,76.89,0);
            }
break;
        
case 1015://初级副本传送[26] 黑暗深渊
            {
                
//Plr->EventTeleport(48,-150.367004,102.995003,-40.555801);
                Teleport(Plr,48,-150.367004,102.995003,-40.555801,0);
            }
break;
        
case 1016://初级副本传送[27] 暴风城监狱
            {
                
//Plr->EventTeleport(34,48.29,0.45,-16.14);
                Teleport(Plr,34,48.29,0.45,-16.14,0);
            }
break;
        
case 1017://初级副本传送[31] 剃刀沼泽
            {
                
//Plr->EventTeleport(47,1943,1544,82);
                Teleport(Plr,47,1943,1544,82,0);
            }
break;
        
case 1018://初级副本传送[33] 诺莫瑞根
            {
                
//Plr->EventTeleport(90,-332.562988,-3.445,-152.845993);
                Teleport(Plr,90,-332.562988,-3.445,-152.845993,0);
            }
break;
        
case 1019://初级副本传送[40] 血色修道院
            {
                
//Plr->EventTeleport(189,855.903992,1321.939941,18.673000);
                Teleport(Plr,189,855.903992,1321.939941,18.673000,0);
            }
break;
        
case 10110://初级副本传送[42] 剃刀高地
            {
                
//Plr->EventTeleport(129,2593.209961,1109.459961,51.093300);
                Teleport(Plr,129,2593.209961,1109.459961,51.093300,0);
            }
break;
        
case 10111://初级副本传送[45] 奥达曼 
            {
                
//Plr->EventTeleport(70,-227.529007,45.009800,-46.019600);
                Teleport(Plr,70,-227.529007,45.009800,-46.019600,0);
            }
break;


        
case 102://中级副本传送
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" [46] 祖尔法拉克 ",      1021); 
                Menu
->AddItem(5" [49] 玛拉顿 ",          1022); 
                Menu
->AddItem(5" [53] 失落的神庙 ",      1023); 
                Menu
->AddItem(5" [57] 黑石深渊 ",        1024); 
                Menu
->AddItem(5" [60] 通灵学院 ",        1025); 
                Menu
->AddItem(5" [60] 厄运之槌 (北区) "1026); 
                Menu
->AddItem(5" [60] 厄运之槌 (东区) "1027); 
                Menu
->AddItem(5" [60] 厄运之槌 (西区) "1028); 
                Menu
->AddItem(5" [60] 斯坦索姆 ",        1029); 
                Menu
->AddItem(5" [60] 黑石塔下 ",        10210);
                Menu
->AddItem(0"[返回]",                    99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1021://中级副本传送[46] 祖尔法拉克
            {
                
//Plr->EventTeleport(70,-227.529007,45.009800,-46.019600);
                Teleport(Plr,70,-227.529007,45.009800,-46.019600,0);
            }
break;
        
case 1022://中级副本传送[49] 玛拉顿
            {
                
//Plr->EventTeleport(349,1012.700012,-459.317993,-43.547100);
                Teleport(Plr,349,1012.700012,-459.317993,-43.547100,0);
            }
break;
        
case 1023://中级副本传送[53] 失落的神庙
            {
                
//Plr->EventTeleport(109,-313.369995,99.955399,-131.848999);
                Teleport(Plr,109,-313.369995,99.955399,-131.848999,0);
            }
break;
        
case 1024://中级副本传送[57] 黑石深渊
            {
                
//Plr->EventTeleport(230,456.928986,34.927700,-69.388100);
                Teleport(Plr,230,456.928986,34.927700,-69.388100,0);
            }
break;
        
case 1025://中级副本传送[60] 通灵学院
            {
                
//Plr->EventTeleport(289,199,126,135);
                Teleport(Plr,289,199,126,135,0);
            }
break;
        
case 1026://中级副本传送[60] 厄运之槌 (北区) 
            {
                
//Plr->EventTeleport(429,255.164001,-17.024200,-2.560600);
                Teleport(Plr,429,255.164001,-17.024200,-2.560600,0);
            }
break;
        
case 1027://中级副本传送[60] 厄运之槌 (东区)
            {
                
//Plr->EventTeleport(429,46.24,-155.53,-2.71349);
                Teleport(Plr,429,46.24,-155.53,-2.71349,0);
            }
break;
        
case 1028://中级副本传送[60] 厄运之槌 (西区)
            {
                
//Plr->EventTeleport(429,32.722599,159.417007,-3.470170);
                Teleport(Plr,429,32.722599,159.417007,-3.470170,0);
            }
break;
        
case 1029://中级副本传送[60] 斯坦索姆
            {
                
//Plr->EventTeleport(329,3392,-3379,143);
                Teleport(Plr,329,3392,-3379,143,0);
            }
break;
        
case 10210://中级副本传送[60] 黑石塔下
            {
                
//Plr->EventTeleport(229,78.19,-227.63,49.72);
                Teleport(Plr,229,78.19,-227.63,49.72,0);
            }
break;

        
case 103://团队副本传送
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" [团] 溶火之心 ",         1031); 
                Menu
->AddItem(5" [团] 黑石塔上 ",         1032); 
                Menu
->AddItem(5" [团] 祖尔格拉布 ",       1033); 
                Menu
->AddItem(5" [团] 黑翼之巢 ",         1034); 
                Menu
->AddItem(5" [团] 安其拉 ",           1035); 
                Menu
->AddItem(5" [团] 安其拉废墟 ",       1036); 
                Menu
->AddItem(5" [团] 奥妮克希亚的巢穴 "1037); 
                Menu
->AddItem(5" [团] 纳克萨玛斯 ",       1038); 
                Menu
->AddItem(5" [团] 冰龙巢穴 ",         1039);
                Menu
->AddItem(0"[返回]",                       99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1031://团队副本传送[团] 溶火之心
            {
                
//Plr->EventTeleport(409,1089.601685,-470.190247,-106.413055);
                Teleport(Plr,409,1089.601685,-470.190247,-106.413055,0);
            }
break;
        
case 1032://团队副本传送[团] 黑石塔上
            {
                
//Plr->EventTeleport(229,78.339836,-227.793518,49.7103);
                Teleport(Plr,229,78.339836,-227.793518,49.7103,0);
            }
break;
        
case 1033://团队副本传送[团] 祖尔格拉布
            {
                
//Plr->EventTeleport(309,-11916,-1251.469971,92.32);
                Teleport(Plr,309,-11916,-1251.469971,92.32,0);
            }
break;
        
case 1034://团队副本传送[团] 黑翼之巢
            {
                
//Plr->EventTeleport(469,-7674.470215,-1108.380005,396.649994);
                Teleport(Plr,469,-7674.470215,-1108.380005,396.649994,0);
            }
break;
        
case 1035://团队副本传送[团] 安其拉
            {
                
//Plr->EventTeleport(531,-8212.002930,2034.474854,129.141342);
                Teleport(Plr,531,-8212.002930,2034.474854,129.141342,0);
            }
break;
        
case 1036://团队副本传送[团] 安其拉废墟
            {
                
//Plr->EventTeleport(509,-8443.475586,1518.648560,31.906958);
                Teleport(Plr,509,-8443.475586,1518.648560,31.906958,0);
            }
break;
        
case 1037://团队副本传送[团] 奥妮克希亚的巢穴
            {
                
//Plr->EventTeleport(249,30.010290,-58.840508,-5.325367);
                Teleport(Plr,249,30.010290,-58.840508,-5.325367,0);
            }
break;
        
case 1038://团队副本传送[团] 纳克萨玛斯
            {
                
//Plr->EventTeleport(533,3005.87,-3435.01,293.882);
                Teleport(Plr,533,3005.87,-3435.01,293.882,0);
            }
break;
        
case 1039://团队副本传送[团] 冰龙巢穴
            {
                
//Plr->EventTeleport(533,3700.35,-5185.92,143.957);//player->TeleportTo(533,3700.35,-5185.92,143.957,4.403038,0); 
                Teleport(Plr,533,3700.35,-5185.92,143.957,0);
            }
break;

        
case 104://外域副本传送1
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" [团] 暴风城超级监狱 "1041); 
                Menu
->AddItem(5" [团] 卡拉赞 ",         1042); 
                Menu
->AddItem(5" [团] 遗忘之井",        1043); 
                Menu
->AddItem(5" [团] 鬼魂之地 ",       1044); 
                Menu
->AddItem(5" [团] 地狱火堡垒 ",     1045); 
                Menu
->AddItem(5" [团] 风暴要塞 ",       1046); 
                Menu
->AddItem(5" [团] 奥金顿 ",         1047); 
                Menu
->AddItem(5" [团] 黑暗神庙 ",       1048); 
                Menu
->AddItem(5" [团] 赞格沼泽 ",       1049); 
                Menu
->AddItem(5" [团] 格鲁尔的巢穴 ",   10410); 
                Menu
->AddItem(5" [团] 黑色沼泽 ",       10411); 
                Menu
->AddItem(5" [团] 盘牙洞穴 ",       10412); 
                Menu
->AddItem(5" [团] 玛瑟里顿的巢穴 "10413); 
                Menu
->AddItem(0"[返回]",                   99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1041://外域副本传送1[团] 暴风城超级监狱
            {
                
//Plr->EventTeleport(0,-8644.160156,595.669983,95.699997);
                Teleport(Plr,0,-8644.160156,595.669983,95.699997,0);
            }
break;
        
case 1042://外域副本传送1[团] 卡拉赞
            {
                
//Plr->EventTeleport(532, -11107.950195, -2002.060059, 49.889999);
                Teleport(Plr,532-11107.950195-2002.06005949.889999,0);
            }
break;
        
case 1043://外域副本传送1[团] 遗忘之井
            {
                
//Plr->EventTeleport(0, -11068.07313, -1811.069946, 52.820000);
                Teleport(Plr,0-11068.07313-1811.06994652.820000,0);
            }
break;
        
case 1044://外域副本传送1[团] 鬼魂之地
            {
                
//Plr->EventTeleport(530, 6851.197266, -7993.672852, 192.292496);
                Teleport(Plr,5306851.197266-7993.672852192.292496,0);
            }
break;
        
case 1045://外域副本传送1[团] 地狱火堡垒 
            {
                
//Plr->EventTeleport(543, -1355.817261, 1646.834595, 68.447365);
                Teleport(Plr,543-1355.8172611646.83459568.447365,0);
            }
break;
        
case 1046://外域副本传送1[团] 风暴要塞
            {
                
//Plr->EventTeleport(530, 3087.556885, 1387.229980, 185.037415);
                Teleport(Plr,5303087.5568851387.229980185.037415,0);
            }
break;
        
case 1047://外域副本传送1[团] 奥金顿
            {
                
//Plr->EventTeleport(555, 2.164014, 0.402381, -1.127880);
                Teleport(Plr,5552.1640140.402381-1.127880,0);
            }
break;
        
case 1048://外域副本传送1[团] 黑暗神庙
            {
                
//Plr->EventTeleport(530, -3562.800049, 247.600006, 42.896927);
                Teleport(Plr,530-3562.800049247.60000642.896927,0);
            }
break;
        
case 1049://外域副本传送1[团] 赞格沼泽
            {
                
//Plr->EventTeleport(530, 919.007629, 6854.861816, -66.432899);
                Teleport(Plr,530919.0076296854.861816-66.432899,0);
            }
break;
        
case 10410://外域副本传送1[团] 格鲁尔的巢穴
            {
                
//Plr->EventTeleport(530, 3543.437012, 5079.009766, 0.952552);
                Teleport(Plr,5303543.4370125079.0097660.952552,0);
            }
break;
        
case 10411://外域副本传送1[团] 黑色沼泽
            {
                
//Plr->EventTeleport(269, -2095.298584, 7125.536133, 34.588596);
                Teleport(Plr,269-2095.2985847125.53613334.588596,0);
            }
break;
        
case 10412://外域副本传送1[团] 盘牙洞穴
            {
                
//Plr->EventTeleport(548, 29.142296, -57.074600, -71.733269);
                Teleport(Plr,54829.142296-57.074600-71.733269,0);
            }
break;
        
case 10413://外域副本传送1[团] 玛瑟里顿的巢穴
            {
                
//Plr->EventTeleport(544, 188.414261, 29.327892, 67.934464);
                Teleport(Plr,544188.41426129.32789267.934464,0);
            }
break;                 

        
case 105://外域副本传送2
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" [团] 破碎大厅 "1051); 
                Menu
->AddItem(5" [团] 血熔炉 ",   1052); 
                Menu
->AddItem(5" [团] 波塔尼卡 "1053); 
                Menu
->AddItem(5" [团] 亚克崔兹 "1054); 
                Menu
->AddItem(5" [团] 麦克那尔 "1055); 
                Menu
->AddItem(5" [团] 凤凰大厅 "1056); 
                Menu
->AddItem(5" [团] 奴隶监狱 "1057); 
                Menu
->AddItem(5" [团] 蒸汽洞窟 "1058); 
                Menu
->AddItem(5" [团] 毒牙沼泽 "1059);                                
                Menu
->AddItem(0"[返回]",               99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1051://外域副本传送2[团] 破碎大厅
            {
                
//Plr->EventTeleport(540, -41.000000, -22.000000, -14.000000);
                Teleport(Plr,540-41.000000-22.000000-14.000000,0);
            }
break
        
case 1052://外域副本传送2[团] 血熔炉
            {
                
//Plr->EventTeleport(542, -3.000000, 11.000000, -45.000000);
                Teleport(Plr,542-3.00000011.000000-45.000000,0);
            }
break
        
case 1053://外域副本传送2[团] 波塔尼卡
            {
                
//Plr->EventTeleport(553, 40.000000, -28.600000, -1.100000);
                Teleport(Plr,55340.000000-28.600000-1.100000,0);
            }
break
        
case 1054://外域副本传送2[团] 亚克崔兹
            {
                
//Plr->EventTeleport(552, -1.200000, 0.000000, -0.200000);
                Teleport(Plr,552-1.2000000.000000-0.200000,0);
            }
break
        
case 1055://外域副本传送2[团] 麦克那尔
            {
                
//Plr->EventTeleport(554, -28.900000, 0.700000, -1.800000);
                Teleport(Plr,554-28.9000000.700000-1.800000,0);
            }
break
        
case 1056://外域副本传送2[团] 凤凰大厅
            {
                
//Plr->EventTeleport(550, -6.800000, -0.900000, -2.400000);
                Teleport(Plr,550-6.800000-0.900000-2.400000,0);
            }
break
        
case 1057://外域副本传送2[团] 奴隶监狱
            {
                
//Plr->EventTeleport(547, 123.146225, -122.687210, -0.446336);
                Teleport(Plr,547123.146225-122.687210-0.446336,0);
            }
break
        
case 1058://外域副本传送2[团] 蒸汽洞窟
            {
                
//Plr->EventTeleport(545, -7.500000, 5.900000, -4.300000);
                Teleport(Plr,545-7.5000005.900000-4.300000,0);
            }
break
        
case 1059://外域副本传送2[团] 毒牙沼泽
            {
                
//Plr->EventTeleport(546, 14.913731, -19.914341, -2.755679);
                Teleport(Plr,54614.913731-19.914341-2.755679,0);
            }
break

        
case 106://个人银行
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem( 0" 暂时不提供!有什么问题联系QQ:55580780 "1061 );                    
                Menu
->AddItem(0"[返回]",        99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 107://开通飞行点
            {
                
for (uint8 i=0; i<8; i++
                { Plr
->SetTaximask(i, 0xFFFFFFFF);} 
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem( 0" 飞行点已开,请返回! "1071 );
                Menu
->AddItem(0"[返回]",               99);
                Menu
->SendTo(Plr);    

         
            }
break;
        
case 108://领取工资10G/小时
            {

                
if((int)Plr->GetPlayedtime() > 3600// 条件检查你在线时间大于60秒.这可以自己改 
                { 
                    objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                    Menu
->AddItem( 0" 您已经上线超过一小时,但是本服务器暂时不提供此项功能! "1081 );
                    Menu
->AddItem(0"[返回]",               99);
                    Menu
->SendTo(Plr);    
                } 
                
else 
                { 
                    objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                    Menu
->AddItem( 0" 您上线不足一小时,请返回! "1081 );
                    Menu
->AddItem(0"[返回]",               99);
                    Menu
->SendTo(Plr);    
                }         
            }
break;
        
case 109://外域传送(5G)
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 黑暗之门 "1091); 
                Menu
->AddItem(5" 永歌森林 "1092); 
                Menu
->AddItem(5" 艾克索达 "1093); 
                Menu
->AddItem(5" 海加尔山 "1094); 
                Menu
->AddItem(5" 青草平原 "1095); 
                Menu
->AddItem(5" 翠叶森林 "1096); 
                Menu
->AddItem(5" 沙塔斯城 "1097); 
                Menu
->AddItem(5" 哈兰 ",     1098); 
                Menu
->AddItem(5" 风暴尖塔 "1099);
                Menu
->AddItem(0"[返回]",        99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1091://外域传送?黑暗之门
            {
                Plr
->EventTeleport(530,-246.600006,946.000000,84.400002);
            }
break
        
case 1092://外域传送?永歌森林
            {
                Plr
->EventTeleport(530,9336.900391,-7278.399902,13.600000);
            }
break
        
case 1093://外域传送?艾克索达
            {
                Plr
->EventTeleport(530,-4043.632813,-11933.284180,-0.057945);
            }
break
        
case 1094://外域传送?海加尔山
            {
                Plr
->EventTeleport(534,5070.084473,-1791.984497,1320.995483);
            }
break
        
case 1095://外域传送?青草平原
            {
                Plr
->EventTeleport(169,-2674.500000,-2275.800049,148.092743);
            }
break
        
case 1096://外域传送?翠叶森林
            {
                Plr
->EventTeleport(169,2737.508057,-3318.579590,101.882820);
            }
break
        
case 1097://外域传送?沙塔斯城
            {
                Plr
->EventTeleport(530,-1889,5433,-11);
            }
break
        
case 1098://外域传送?哈兰
            {
                Plr
->EventTeleport(530,-1567,7959,-21);
            }
break
        
case 1099://外域传送?风暴尖塔
            {
                Plr
->EventTeleport(530,4151,3041,339);
            }
break

        
case 110://野外BOSS传送(10G)
            {
                objmgr.CreateGossipMenuForPlayer(
&Menu, pCreature->GetGUID(), 1, Plr);
                Menu
->AddItem(5" 暮色森林 "1101); 
                Menu
->AddItem(5" 辛特兰 ",   1102); 
                Menu
->AddItem(5" 灰谷 ",     1103); 
                Menu
->AddItem(5" 艾萨拉 ",   1104); 
                Menu
->AddItem(5" 菲拉斯 ",   1105); 
                Menu
->AddItem(5" 诅咒之地 "1106); 
                Menu
->AddItem(5" 水晶谷 ",   1107);
                Menu
->AddItem(0"[返回]",      99);
                Menu
->SendTo(Plr);            
            }
break;
        
case 1101://野外BOSS传送暮色森林
            {
                Plr
->EventTeleport(0,-10526.168945,-434.996796,50.894821);
            }
break
        
case 1102://野外BOSS传送辛特兰
            {
                Plr
->EventTeleport(0,759.605713,-3893.341309,116.475304);
            }
break
        
case 1103://野外BOSS传送灰谷
            {
                Plr
->EventTeleport(1,3120.289307,-3439.444336,139.566345);
            }
break
        
case 1104://野外BOSS传送艾萨拉
            {
                Plr
->EventTeleport(1,2622.219971,-5977.930176,100.562897);
            }
break
        
case 1105://野外BOSS传送菲拉斯
            {
                Plr
->EventTeleport(1,-2741.290039,2009.481323,31.877323);
            }
break
        
case 1106://野外BOSS传送诅咒之地
            {
                Plr
->EventTeleport(0,-12234.000000,-2474.000000,-3.000000);
            }
break
        
case 1107://野外BOSS传送水晶谷
            {
                Plr
->EventTeleport(1,-6292.463379,1578.029053,0.155348);
            }
break

        }
    }

public:
    
struct instancelist
    {
        uint32 InstanceId ;
        uint32 MapId;
        uint32 Creation;
        uint32 GroupSignature;
        uint32 Creator;
        uint32 ExpireTime;
        uint32 difficulty;
    };

    instancelist activeinstance[
1000];
    
int i,j;
    
static const int k = 1;

private:

void Teleport(Player* plr,uint32 mapid, float x, float y, float z,int flag) //flag 判断(根据权限)是否需要单独加入副本 预留
{
    uint32 instanceid 
= 0;

    
if (j<k)
    {
        
for(i=0;i<1000;i++)
        {
            activeinstance[i].InstanceId
=0;
            activeinstance[i].MapId
=0;
            activeinstance[i].Creation
=0;
            activeinstance[i].GroupSignature
=0;
            activeinstance[i].Creator
=0;
            activeinstance[i].ExpireTime
=0;
            activeinstance[i].difficulty
=0;
        }
        j
=10;
        sLog.outString(
" 初始化副本存储结构 ");
    }


    MapMgr 
* mapMgr = NULL;
    
for(i=0;i<1000;i++)
    {
        sLog.outString(
" #副本[%u]  地图[%u]# ",activeinstance[i].InstanceId, activeinstance[i].MapId);
        mapMgr 
= sWorldCreator.GetMap(activeinstance[i].MapId)->GetRawInstance(activeinstance[i].InstanceId);
        
if(mapMgr)
        {
            
if(!mapMgr->HasPlayers())
            {
                
//sWorldCreator.GetMap(mapid)->DestroyMapMgrInstance(instanceid);
                
//sLog.outDebug("Instance %i on map %i deleted with success\n", instanceid, mapid);
                sLog.outString(" #副本[%u]  地图[%u]# 没有玩家 删除副本数据 ",activeinstance[i].InstanceId, activeinstance[i].MapId);
                activeinstance[i].InstanceId 
=0;
                activeinstance[i].MapId 
=0;

            }
        }
        
//else
        
//{
            
//sLog.outDebug("Instance %i failed to be deleted, reason: Doesnt Exist\n", instanceid);
        
//    sLog.outString(" #副本[%u]  地图[%u]# 副本不存在 ",activeinstance[i].InstanceId, activeinstance[i].MapId);
        
//}

        
if (activeinstance[i].MapId == 0)
        {
            sLog.outString(
" 提示:没有找到该地图的副本 ");
            
break;
        }
        
else if (activeinstance[i].MapId == mapid)
        {
            instanceid 
= activeinstance[i].InstanceId;
            
break;
        }

        
if(i == 999//一直找不到 执行一次清零
        {
            j 
= 0;
        }
    }

    
if (flag == 0)
    {
        
//MapMgr *instance = sWorldCreator.GetInstance(instanceid);
        if(instanceid == 0)
        {
            Map 
*pMap = sWorldCreator.GetMap(mapid);
            MapMgr 
*pMapMgr = pMap->CreateMapMgrInstance();
            sLog.outString(
" 玩家:[%s] 创建副本 #ID[%u]  地图[%u]# ",plr->GetName(), pMapMgr->GetInstanceID(), pMapMgr->GetMapId());
            activeinstance[i].MapId 
=mapid;
            activeinstance[i].InstanceId 
=pMapMgr->GetInstanceID();
            
//sLog.outString("activeinstance %d :Instance %u - MapId %u .", i,activeinstance[i-1].InstanceId, activeinstance[i-1].MapId);
            plr->SafeTeleport(mapid,pMapMgr->GetInstanceID(),LocationVector(x,y,z));
            
return;
        }
        MapMgr 
*instance = sWorldCreator.GetInstance(mapid,instanceid);
        mapid 
= instance->GetMapId();
        plr
->SaveEntryPoint(mapid);
        plr
->RemoveFromWorld();
        plr
->SetInstanceID(instanceid);
        plr
->SetMapId(mapid);
        plr
->SetPosition(x,y,z,0,true);
        WorldPacket data(SMSG_TRANSFER_PENDING, 
4);
        uint32 pid 
= mapid;
        data 
<< pid;
        plr
->GetSession()->SendPacket(&data);
        WorldPacket data2(SMSG_NEW_WORLD, 
20);
        data2 
<< mapid << x << y << z << (float)3.14;
        plr
->GetSession()->SendPacket(&data2);
        sLog.outString(
" 玩家:[%s] 进入副本 #ID[%u]  地图[%u]# ",plr->GetName(), instance->GetInstanceID(), instance->GetMapId());
    
    }
    
else
    {
        Map 
*pMap = sWorldCreator.GetMap(389);
        MapMgr 
*pMapMgr = pMap->CreateMapMgrInstance();
        sLog.outString(
" 超级玩家:[%s] 创建副本 %u #ID[%u]  地图[%u]# ",plr->GetName(), pMapMgr->GetInstanceID(), pMapMgr->GetMapId());
        plr
->SafeTeleport(389,pMapMgr->GetInstanceID(),LocationVector(2.024650,-10.021000,-16.187500));    
        
//activeinstance[i].MapId =mapid; //不做记录
        
//activeinstance[i].InstanceId =pMapMgr->GetInstanceID();
    }
}

};

void SetupCustom_Teleporters(ScriptMgr * mgr)
{
    
/* Teleporter List */
    mgr
->register_gossip_script(999999&TeleportNPC::Create);          // Osciron
}
posted on 2007-08-28 21:44 聂文龙 阅读(1056) 评论(3)  编辑 收藏 引用 所属分类: ascent

FeedBack:
# re: [script][ascent]副本传送 2007-09-08 18:03 yuewuxue
不错,收下了 慢慢研究~  回复  更多评论
  
# re: [script][ascent]副本传送 2007-09-10 19:21 聂文龙
# re: [script][ascent]副本传送 2007-09-15 18:51 JC
請問 要整樣使用阿?? 放在哪裡
整樣把NPC叫出來  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理