随笔 - 298  文章 - 377  trackbacks - 0
<2007年8月>
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(34)

随笔分类

随笔档案

文章档案

相册

收藏夹

搜索

  •  

最新评论

阅读排行榜

评论排行榜

一、在items.scp中添加下面代码
[item31023]
name=奇迹宝石
questscript=MemberInfo
description=
class=12
quality=5
startquest=30010//这里不能修改
reqlevel=1
quality=1
buyprice=1000000
bonding=4
classes=07FF
model=29691
level=1
races=0FF
stackable=1
maxcount=1
material=-1
pagetext=1
language=1
二、在pages.scp中添加下面代码
[page1]
text=<HTML>
text=<BODY>
text=<H1align="center">WelcometoWorldofDarkness</H1>
text=<BR/>
text=<IMGsrc="Interface\Cursor\GatherHerbs"align="left"/>
text=<IMGsrc="Interface\Cursor\GatherHerbs"align="right"/>
text=<Palign="center">Greetings,<BR/>$N</P>
text=<BR/>
text=<IMGsrc="Interface\WorldMap\WorldMap-Icon"align="right"/>
text=<Palign="left">WelcomeToourserver.<BR/>Wehopeyouenjoyithere.<BR/>IfyouwantTogetinTouch<BR/>withus,ThenJoinushere:</P>
text=<BR/>
text=<IMGsrc="Interface\Glues\CharacterCreate\UI-RotationRight-Big-Up"align="left"/>
text=<Palign="right">ROBBS:roworld.no-ip.info</P>
text=<Palign="right">roworld.xicp.net</P>
text=<BR/>
text=<BR/>
text=<Palign="left">NowhaveagoodTimeexploringand<BR/>experiencingWorldOfWarcraft<BR/>withyournew$r$c.</P>
text=<BR/>
text=<IMGsrc="Interface\TalentFrame\PaladinProtection-TopLeft"align="left"/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=<BR/>
text=</BODY>
text=</HTML>
text=
三、在quests.scp中添加下面代码
[quest30010]
name=帮助系统
levels=1255
reward_xp=0
desc=欢迎使用帮助系统
details=支持我们
zone=0

[quest30011]
name=〖随身出售〗
levels=00
reward_xp=0
zone=0

[quest30012]
name=〖随身银行〗
levels=00
reward_xp=0
zone=0

[quest30013]
name=〖记忆位置〗
levels=00
reward_xp=0
zone=0

[quest30014]
name=〖传送服务〗
levels=00
reward_xp=0
zone=0

[quest30015]
name=〖游戏好友〗
levels=00
reward_xp=0
zone=0

[quest30016]
name=〖卡号自救〗
levels=00
reward_xp=0
zone=0

[quest30017]
name=〖使用说明〗
levels=00
reward_xp=0
zone=0

[quest30018]
name=〖原地复活〗
levels=00
reward_xp=0
zone=0
四、在creatures.scp中添加下面代码
[creature31023]//这里不能修改
name=随身NPC
questscript=MemberMan//这里不能修改
flags1=08480046
guild=玩家NPC
npcflags=04002
npctext0_0=你好,$N,玩家随身NPC。
qtgids0=50000
attack=191210.1
bounding_radius=0.208
civilian=1
combat_reach=2.21
damage=0.81.2
equipmodel=07439242133000
faction=35
level=10
loottemplate=54
maxhealth=334
maxmana=220
model=1287
money=12600
speed=0.96
type=7[/post]




namespaceevalMemberInfo{}

procMemberInfo::QueryQuest{objplayerquestid}{
SendQuestsList$player$obj3001130012300133001430015300163001730018
}

procMemberInfo::QuestSelect{objplayerquestid}{
SendGossipComplete$player
switch$questid{
30011{setguaid[GetSelection$player]
if{[GetSelection$player]=="0"}{SendGossip$player$obj{npctext1}{text0"请选择一个怪物,尸体或npc,距离必须4码以内才能使用随身银行!!";return
}}
if{[GetSelection$player]!="0"}{VendorList$player$guaid}}
30012{setguaid[GetSelection$player]
if{[GetSelection$player]=="0"}{SendGossip$player$obj{npctext1}{text0"请选择一个怪物,尸体或npc,距离必须4码以内才能使用随身银行!!";return
}}
if{[GetSelection$player]!="0"}{BankerList$player$guaid}}
30013{SetBindpoint$player;SendGossip$player$obj{npctext1}{text7"恭喜你,位置记忆成功.?返回主菜单..."}}
30014{


MemberMan::QuestHello$obj$player}
30015{SendGossip$player$obj{npctext1}{text0"暂不开放"}}
30016{setss[GetBindpoint$player]
setmap[lindex$ss0]
setx[lindex$ss1]
sety[lindex$ss2]
setz[lindex$ss3]
Teleport$player$map$x$y$z}
30017{setfiles"ARK/Memberhelp.txt";if{[fileexists$files]==1}{HelpInfo::readfile$player$obj$files}}
30018{Resurrect$player}
default{SendGossip$player$obj{npctext1}{text0"building..."}
}

}

}


procMemberInfo::GossipSelect{objplayeroption}{
Say$player0"\nMemberInfo::GossipSelect"
}


procMemberInfo::QuestAccept{objplayerquestid}{
#Say$player0"\nMemberInfo::QuestAccept"
}

procMemberInfo::QuestChooseReward{objplayerquestidchoose}{
Say$player0"\nMemberInfo::QuestChooseReward"
}

procMemberInfo::QuestHello{objplayer}{
Say$player0"\nMemberInfo::QuestHello"
}


procMemberInfo::OnOpen{objplayerlootid}{
Say$player0"\nMemberInfo::OnOpen"
}
;#-=-=-=-=-=-=-=-=-=-=-=-=-
;

namespaceevalMemberMan{}
procMemberMan::QuestStatus{objplayer}{setreply7;return$reply}
procMemberMan::GossipHello{objplayer}{MemberMan::QuestHello$obj$player}
procMemberMan::QuestHello{objplayer}{
Point:ointset$playerMemberMan"MainMenu"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text1"------------------"}\
{text1"城市传送"}\
{text3"副本传送1"}\
{text3"副本传送2"}\
{text3"副本传送3"}\
{text3"副本传送4"}\
{text2"战场传送"}\
{text1"------------------"}\
{text7"请把我的炉石绑定在这里!?"}\
{text7"请帮我激活所有的飞行点!?"}

}
procMemberMan::GossipSelect{objplayeroption}{
SendSwitchGossip$player$obj1
setmenu[Point:ointread$playerMemberMan]
switch$menu{
"MainMenu"{switch$option{
1{
Say$obj0"欢迎使用玩家帮助系统——传送NPC,请问您要去哪个城市?"
Point:ointset$playerMemberMan"Teleport"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text0"返回主菜单..."}\
{text5"1传送到暴风城---1金"}\
{text5"2传送到铁炉堡---1金"}\
{text5"3传送到达纳苏斯---1金"}\
{text5"4传送到奥格瑞玛---1金"}\
{text5"5传送到雷霆崖---1金"}\
{text5"6传送到幽暗城---1金"}\
{text5"7传送到棘齿城---1金"}\
{text5"8传送到藏宝海湾---1金"}

Emote$obj$player163
}
2{
Say$obj0"欢迎使用玩家帮助系统——传送NPC,请问您要去哪个城市?"
Point:ointset$playerMemberMan"FBTeleport1"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text0"返回主菜单..."}\
{text5"1熔火之心---10金"}\
{text5"2死亡矿井---10金"}\
{text5"3通灵学院---10金"}\
{text5"4黑石深渊---10金"}\
{text5"5奥尼克西亚的巢穴---10金"}\
{text5"6暴风城监狱---10金"}\
{text5"7影牙城堡---10金"}\
{text5"8哀号洞穴---10金"}

Emote$obj$player163
}
3{
Say$obj0"欢迎使用玩家帮助系统——传送NPC,请问您要去哪个城市?"
Point:ointset$playerMemberMan"FBTeleport2"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text0"返回主菜单..."}\
{text5"1剃刀沼泽1---10金"}\
{text5"2剃刀沼泽2---10金"}\
{text5"3奥达曼——守护者大厅---10金"}\
{text5"4诺莫瑞根——发条小泾---10金"}\
{text5"5剃刀高地---10金"}\
{text5"6阿塔哈卡神庙---10金"}\
{text5"7祖尔法拉克---10金"}\
{text5"8黑手大厅---10金"}

Emote$obj$player163
}
4{
Say$obj0"欢迎使用玩家帮助系统——传送NPC,请问您要去哪个城市?"
Point:ointset$playerMemberMan"FBTeleport3"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text0"返回主菜单..."}\
{text5"1斯坦索姆---10金"}\
{text5"2怒焰裂谷---10金"}\
{text5"3玛拉顿——邪魔洞穴---10金"}\
{text5"4黑翼之巢---10金"}\
{text5"5安其拉废墟---20金"}\
{text5"6安其拉---20金"}

Emote$obj$player163
}
5{
Say$obj0"欢迎使用玩家帮助系统——传送NPC,请问您要去哪个城市?"
Point:ointset$playerMemberMan"FBTeleport4"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text0"返回主菜单..."}\
{text5"1黑暗之门---20金"}\
{text5"2翡翠森林---20金"}\
{text5"3时光巨洞---20金"}\
{text5"4海加尔山---20金"}\
{text5"5地铁海底---20金"}\
{text5"6艾尔文之塔---20金"}\
{text5"7GM之岛---20金"}

Emote$npc$player163
}
6{
if{[Warsong::AddToQueue$player]}{
setAlliance"4891538.041481.46352.409"
setHorde"489918.0491434.1346.476"
if{[Custom::GetPlayerSide$player]==0}{Custom::TeleportPos$player$Alliance
}else{Custom::TeleportPos$player$Horde}
#Emote$obj4
}else{
SendGossip$player$obj{npctext1}{text0"战场关闭了."}

}
}
11{
Point:ointset$playerMemberMan"Others"
SendSwitchGossip$player$obj1
SendGossip$player$obj{npctext1}\
{text7"??返回主菜单"}\
{text7"请把我的炉石绑定在这里!?"}\
{text7"请帮我激活所有的飞行点!?"}
}
5{SetBindpoint$player;Point:ointset$playerMemberMan"Back";SendGossip$player$obj{npctext1}{text7"恭喜你,绑定成功?.??返回主菜单..."}
}
6{Point:ointset$playerMemberMan"TaxiNode"
settmp[Point:ointread$playerTaxiNode]
if{$tmp>=77}{Point:ointset$playerMemberMan"Back";SendGossip$player$obj{npctext1}"text7恭喜你,所有飞行点已经全部激活,点击返回主菜单!";return}
settmp2[expr$tmp*1.2]
SendGossip$player$obj{npctext1}"text7已激活?$tmp2%"

}
default{SendGossip$player$obj{npctext1}{text7"??返回主菜单"}
}
}}
"TaxiNode"{
settmp[Point:ointread$playerTaxiNode]
if{$tmp>=77}{Point:ointset$playerMemberMan"Back";SendGossip$player$obj{npctext1}"text7恭喜你,所有飞行点已经全部激活,点击返回主菜单!";return}
if{$tmp>=0&&$tmp<=71}{TaxiNodeExplorered$player$tmp
TaxiNodeExplorered$player[expr$tmp+1]
TaxiNodeExplorered$player[expr$tmp+2]
TaxiNodeExplorered$player[expr$tmp+3]
TaxiNodeExplorered$player[expr$tmp+4]
TaxiNodeExplorered$player[expr$tmp+5]
TaxiNodeExplorered$player[expr$tmp+6]
settmp[expr$tmp+7]
Point:ointset$playerTaxiNode$tmp}
settmp2[expr$tmp*1.2]
SendGossip$player$obj{npctext1}"text7已激活?$tmp2%"
}
"Teleport"{Say$obj0"欢迎下次再来?)"
switch$option{
0{MemberMan::QuestHello$obj$player;return}
1{if{[GetLevel$player]>=1}{
#---------------------[ChangeMoney$player-10000]"-10000"为传送的费用---------------------------------------------#
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0-906543494}}
}
2{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0-5032-819495}}
}
3{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player1996120551329}}
}
4{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player11317-438327}}
}
5{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player1-139114023}}
}
6{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0190923553}}
}
7{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player1-977-37886}}
}
8{if{[GetLevel$player]>=1}{
setmon[ChangeMoney$player-10000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0-143025189}}
}
}

Emote$obj$player163
}
"FBTeleport1"{Say$obj0"欢迎下次再来?)"

switch$option{
0{MemberMan::QuestHello$obj$player;return}
1{if{[GetLevel$player]>=56}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player4091093.45-469.41-105}}
if{[GetLevel$player]<56}{Say$player0"我需要56级才能进入!"}}
2{if{[GetLevel$player]>=11}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player36-16-38362}}
if{[GetLevel$player]<11}{Say$player0"我需要11级才能进入!"}}
3{if{[GetLevel$player]>=41}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player289199126135}}
if{[GetLevel$player]<41}{Say$player0"我需要41级才能进入!"}}
4{if{[GetLevel$player]>=48}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player23045826-69}}
if{[GetLevel$player]<48}{Say$player0"我需要48级才能进入!"}}
5{if{[GetLevel$player]>=56}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player24930-60-55}}
if{[GetLevel$player]<56}{Say$player0"我需要56级才能进入!"}}
6{if{[GetLevel$player]>=19}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player3454.230.28-18}}
if{[GetLevel$player]<19}{Say$player0"我需要19级才能进入!"}}
7{if{[GetLevel$player]>=14}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player33-228.192110.5676.882}}
if{[GetLevel$player]<14}{Say$player0"我需要14级才能进入!"}}
8{if{[GetLevel$player]>=11}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player43-163132-736}}
if{[GetLevel$player]<11}{Say$player0"我需要11级才能进入!"}}

}
Emote$obj$player163
}
"FBTeleport2"{Say$obj0"欢迎下次再来?)"

switch$option{
0{MemberMan::QuestHello$obj$player;return}
1{if{[GetLevel$player]>=21}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player471943154482}}
if{[GetLevel$player]<21}{Say$player0"我需要21级才能进入!"}}
2{if{[GetLevel$player]>=16}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player48-151106-38}}
if{[GetLevel$player]<16}{Say$player0"我需要16级才能进入!"}}
3{if{[GetLevel$player]>=31}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player70-22649-463}}
if{[GetLevel$player]<31}{Say$player0"我需要31级才能进入!"}}
4{if{[GetLevel$player]>=20}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player90-332-2.2-151}}
if{[GetLevel$player]<20}{Say$player0"我需要20级才能进入!"}}
5{if{[GetLevel$player]>=30}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player1292592110752}}
if{[GetLevel$player]<30}{Say$player0"我需要30级才能进入!"}}
6{if{[GetLevel$player]>=41}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==41)}{Teleport$player109-31999.9-131}}
if{[GetLevel$player]<26}{Say$player0"我需要26级才能进入!"}}
7{if{[GetLevel$player]>=40}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player20912138418.9}}
if{[GetLevel$player]<40}{Say$player0"我需要40级才能进入!"}}
8{if{[GetLevel$player]>=44}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player22980-23352}}
if{[GetLevel$player]<44}{Say$player0"我需要44级才能进入!"}}

}
Emote$obj$player163
}
"FBTeleport3"{Say$obj0"欢迎下次再来?)"

switch$option{
0{MemberMan::QuestHello$obj$player;return}
1{if{[GetLevel$player]>=50}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player3293392-3379143}}
if{[GetLevel$player]<50}{Say$player0"我需要50级才能进入!"}}
2{if{[GetLevel$player]>=10}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player3893.8-14.8-17}}
if{[GetLevel$player]<10}{Say$player0"我需要10级才能进入!"}}
3{if{[GetLevel$player]>=36}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player349753-616.5-32}}
if{[GetLevel$player]<36}{Say$player0"我需要36级才能进入!"}}
4{if{[GetLevel$player]>=56}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player469-7671-1106.6397}}
if{[GetLevel$player]<56}{Say$player0"我需要56级才能进入!"}}
5{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-200000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player509-8418.5019531505.94116231.823208}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
6{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-200000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player531-8212.0029302034.474854129.141342}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}

}
Emote$obj$player163
}
"FBTeleport4"{Say$obj0"欢迎下次再来?)"

switch$option{
0{MemberMan::QuestHello$obj$player;return}
1{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0-14958.512761.636.0388}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
2{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player1692732.93-3319.63101.284}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
3{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player2693146.182312.06-146.004}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
4{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-100000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player14603.946777-3879.250977944.183472}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
5{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-200000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player369-9.961661238.17-126.102}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
6{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-200000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player0-11037.7-1999.4992.9823}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}
7{if{[GetLevel$player]>=60}{
setmon[ChangeMoney$player-200000]
if{($mon==0)}{Say$player0"不够钱你传什么啊!";MemberMan::QuestHello$obj$player}
if{($mon==1)}{Teleport$player116222.116252.112.5872}}
if{[GetLevel$player]<60}{Say$player0"我需要60级才能进入!"}}

}
Emote$obj$player163
}

"Back"{MemberMan::QuestHello$obj$player}
default{SendGossip$player$obj{npctext1}{text7"返回主菜单"}
Point:ointset$playerMemberMan"Back"}
}
}



[npctext1]
text0_0=欢迎你,我的朋友!
[npctext9095]
text0_0=欢迎你,我的朋友!
[npctext9310]
text0_0=Hey,$R!$B$BWannausemyfastBattlegroundWarp-Service,eh?$B$BYouarealazyguy...right?$BHehe,noproblem!ButicantguranteethatyourwantedBattlegroundisopen!$BAaah,beforeiforget...therewouldbeNOWarp-Serviceback!$B$BOk,whereyouwannago...

[npctext9311]
text0_0=你真的想去theWarsongGulch?$B$B这是一个CTF-BG(10vs10)!

[npctext9312]
text0_0=你真的想去theArathiBasin?$B$B这是一个DOMINATION-BG(15vs15)!

[npctext9313]
text0_0=你真的想去AlteracValley?$B$B这是一个ASSAULT-BG(40vs40)!

[npctext9314]
text0_0=好吧,但这个服务不是免费的!$B$BI给[1银币]!$B$BT那么我会直接把你送到进入下面的入口处[WarsongGulch]...

[npctext9315]
text0_0=好吧,但这个服务不是免费的!$B$BI给[1银币]!$B$BT那么我会直接把你送到进入下面的入口处[ArathiBasin]...

[npctext9316]
text0_0=好吧,但这个服务不是免费的!$B$BI给[1银币]!$B$BT那么我会直接把你送到进入下面的入口处[AlteracValley]...

[npctext23041]
text0_0=很高兴见到你,朋友!
posted on 2007-08-27 16:21 聂文龙 阅读(2328) 评论(3)  编辑 收藏 引用 所属分类: ascent

FeedBack:
# re: [script][Mangos]奇迹宝石 2007-08-27 16:36 聂文龙
使用该补丁后在Npchandler.cpp里面会出现重复的2个:void WorldSession::SendBindPoint(Creature *npc)
删除一个就可以了

世界传送sql:
99999 16185 0 世界传送 魔兽传送 60 60 43560 43560 999 999 5000 1080 65 1.24 0 121 156.09 100 100 100 0 0 1 0 2 0 0 0 0 1000 2000 100 2 7 1 0 22802 0 0 218171138 234948100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 teleport

奇迹宝石sql
8 12 0 -1 奇迹宝石 奇迹宝石 奇迹宝石 奇迹宝石 7984 1 0 1 0 0 0 -1 -1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 右键点击打开传送菜单 78 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 item_test 0


下面的拷贝下来转换成 文件 补丁.patch ,在svn里面导入就可以了。。。。

Index: src/game/AuctionHouse.cpp
===================================================================
--- src/game/AuctionHouse.cpp (revision 3567)
+++ src/game/AuctionHouse.cpp (working copy)
@@ -45,6 +45,7 @@
}

SendAuctionHello(guid, unit);
+ SendAuctionItemHello(guid); //Karlson 宝石
}

static uint8 AuctioneerFactionToLocation(uint32 faction)
@@ -78,6 +79,15 @@
SendPacket( &data );
}

+ //added by bigbomb Karlson 宝石拍卖行
+void WorldSession::SendAuctionItemHello( uint64 guid )
+ {
+ WorldPacket data( MSG_AUCTION_HELLO, 12 );
+ data << (uint64) guid;
+ //data << (uint32) AuctioneerFactionToLocation(unit->getFaction());
+ SendPacket( &data );
+ } //Karlson 宝石
+
//this function inserts to WorldPacket auction's data
bool WorldSession::SendAuctionInfo(WorldPacket & data, AuctionEntry* auction)
{
Index: src/game/ItemHandler.cpp
===================================================================
--- src/game/ItemHandler.cpp (revision 3567)
+++ src/game/ItemHandler.cpp (working copy)
@@ -28,6 +28,7 @@
#include "Item.h"
#include "UpdateData.h"
#include "ObjectAccessor.h"
+#include "ScriptCalls.h" //传送宝石增加 Karlson

void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data )
{
@@ -364,6 +365,8 @@
if( pItem && pItem->GetProto()->PageText )
{
uint8 msg = _player->CanUseItem( pItem );
+ if(!Script->ItemUse(GetPlayer(),pItem))//传送宝石修改 Karlson
+ { //传送宝石修改 Karlson
if( msg == EQUIP_ERR_OK )
{
data.Initialize (SMSG_READ_ITEM_OK, 8);
@@ -377,6 +380,7 @@
}
data << pItem->GetGUID();
SendPacket(&data);
+ } //传送宝石修改 Karlson
}
else
_player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
Index: src/game/NPCHandler.cpp
===================================================================
--- src/game/NPCHandler.cpp (revision 3567)
+++ src/game/NPCHandler.cpp (working copy)
@@ -33,6 +33,7 @@
#include "MapManager.h"
#include "Pet.h"
#include "WaypointMovementGenerator.h"
+#include "Item.h" //传送宝石修改 Karlson

void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
{
@@ -340,24 +341,27 @@

recv_data >> guid >> option;

- // fix for spirit healers (temp?)
- Creature *temp = ObjectAccessor::Instance().GetCreature(*_player, guid);
- if (!temp)
- return;
-
- uint32 npcflags = UNIT_NPC_FLAG_NONE;
- if(temp->isSpiritHealer())
- npcflags = UNIT_NPC_FLAG_SPIRITHEALER;
-
- Creature *unit = ObjectAccessor::Instance().GetNPCIfCanInteractWith(*_player, guid, npcflags);
- if (!unit)
+ uint16 pos = _player->GetPosByGuid(guid);//传送宝石 Karlson
+ Item *pItem = _player->GetItemByPos( pos ); //传送宝石
+ Creature *unit = ObjectAccessor::Instance().GetNPCIfCanInteractWith(*_player, guid,UNIT_NPC_FLAG_NONE);
+ if (unit)//传送宝石
{
- sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
- return;
- }
-
+ // sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );//传送宝石
+ // return; //传送宝石 Karlson
+
+
+
if(!Script->GossipSelect( _player, unit, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )) )
unit->OnGossipSelect( _player, option );
+ }//传送宝石开始
+ else
+ {
+ if (!Script->GossipSelect_Item( _player, pItem, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )))
+ {
+ sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
+ return;
+ }
+ }//传送宝石结束 Karlson
}

void WorldSession::HandleSpiritHealerActivateOpcode( WorldPacket & recv_data )
@@ -455,6 +459,67 @@
SendBindPoint(unit);
}

+//added by bigbomb 下面是添加的内容 //宝石炉石绑定功能 Karlson
+void WorldSession::SendBindPointHome( uint64 guid )
+{
+ WorldPacket data;
+
+ // binding
+ data.Initialize( SMSG_BINDPOINTUPDATE, (4+4+4+4+4) );
+ data << float(_player->GetPositionX());
+ data << float(_player->GetPositionY());
+ data << float(_player->GetPositionZ());
+ data << uint32(_player->GetMapId());
+ data << uint32(_player->GetZoneId());
+ SendPacket( &data );
+
+ DEBUG_LOG("New Home Position X is %f",_player->GetPositionX());
+ DEBUG_LOG("New Home Position Y is %f",_player->GetPositionY());
+ DEBUG_LOG("New Home Position Z is %f",_player->GetPositionZ());
+ DEBUG_LOG("New Home MapId is %u",_player->GetMapId());
+ DEBUG_LOG("New Home ZoneId is %u",_player->GetZoneId());
+
+ // zone update
+ data.Initialize( SMSG_PLAYERBOUND, 12 );
+ data << uint64(_player->GetGUID());
+ data << uint32(_player->GetZoneId());
+ SendPacket( &data );
+
+ // update sql homebind
+ sDatabase.PExecute("UPDATE `character_homebind` SET `map` = '%u', `zone` = '%u', `position_x` = '%f', `position_y` = '%f', `position_z` = '%f' WHERE `guid` = '%u'", _player->GetMapId(), _player->GetZoneId(), _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow());
+
+ // if a player lost/dropped hist hearthstone, he will get a new one
+ uint32 hearthstone_itemid = 6948;
+ if ( !_player->HasItemCount(hearthstone_itemid, 1) && _player->GetBankItemCount(hearthstone_itemid) <1)
+ {
+ uint16 dest;
+ uint8 msg = _player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, hearthstone_itemid, 1, false );
+ if( msg == EQUIP_ERR_OK )
+ {
+ Item* newitem = _player->StoreNewItem( dest, hearthstone_itemid, 1, true);
+ _player->SendNewItem(newitem, 1, true, false);
+ }
+ else
+ {
+ _player->SendEquipError( msg, NULL, NULL );
+ }
+ }
+
+ // send spell for bind 3286 bind magic
+ data.Initialize(SMSG_SPELL_START, (8+8+2+2+2+4+2) );
+ data.append(_player->GetPackGUID());
+ //data.append(npc->GetPackGUID());
+ data << uint16(3286) << uint16(0x00) << uint16(0x0F) << uint32(0x00)<< uint16(0x00);
+ SendPacket( &data );
+
+ data.Initialize(SMSG_SPELL_GO, (8+8+2+2+1+1+1+8+4+2+2));
+ data.append(_player->GetPackGUID());
+ //data.append(npc->GetPackGUID());
+ data << uint16(3286) << uint16(0x00) << uint8(0x0D) << uint8(0x01)<< uint8(0x01) << _player->GetGUID();
+ data << uint32(0x00) << uint16(0x0200) << uint16(0x00);
+ SendPacket( &data );
+ //_player->PlayerTalkClass->CloseGossip();
+}
void WorldSession::SendBindPoint(Creature *npc)
{
WorldPacket data;
@@ -534,6 +599,87 @@
SendPacket( &data );

_player->PlayerTalkClass->CloseGossip();
+} // 宝石结束 Karlson
+
+void WorldSession::SendBindPoint(Creature *npc)
+{
+ WorldPacket data;
+ uint32 bindspell = 3286, hearthstone_itemid = 6948;
+
+ // update sql homebind
+ sDatabase.PExecute("UPDATE `character_homebind` SET `map` = '%u', `zone` = '%u', `position_x` = '%f', `position_y` = '%f', `position_z` = '%f' WHERE `guid` = '%u'", _player->GetMapId(), _player->GetZoneId(), _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow());
+ _player->m_homebindMapId = _player->GetMapId();
+ _player->m_homebindZoneId = _player->GetZoneId();
+ _player->m_homebindX = _player->GetPositionX();
+ _player->m_homebindY = _player->GetPositionY();
+ _player->m_homebindZ = _player->GetPositionZ();
+
+ // if a player lost/dropped hist hearthstone, he will get a new one
+ if ( !_player->HasItemCount(hearthstone_itemid, 1) && _player->GetBankItemCount(hearthstone_itemid) <1)
+ {
+ uint16 dest;
+ uint8 msg = _player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, hearthstone_itemid, 1, false );
+ if( msg == EQUIP_ERR_OK )
+ {
+ Item* newitem = _player->StoreNewItem( dest, hearthstone_itemid, 1, true);
+ _player->SendNewItem(newitem, 1, true, false);
+ }
+ else
+ {
+ _player->SendEquipError( msg, NULL, NULL );
+ }
+ }
+
+ // send spell for bind 3286 bind magic
+ data.Initialize(SMSG_SPELL_START, (8+8+4+2+4+2+8) );
+ data.append(npc->GetPackGUID());
+ data.append(npc->GetPackGUID());
+ data << bindspell; // spell id
+ data << uint16(0); // cast flags
+ data << uint32(0); // time
+ data << uint16(0x0002); // target mask
+ data.append(_player->GetPackGUID()); // target's packed guid
+ SendPacket( &data );
+
+ data.Initialize(SMSG_SPELL_GO, (8+8+4+2+1+8+1+2+8));
+ data.append(npc->GetPackGUID());
+ data.append(npc->GetPackGUID());
+ data << bindspell; // spell id
+ data << uint16(0x0100); // cast flags
+ data << uint8(0x01); // targets count
+ data << _player->GetGUID(); // target's full guid
+ data << uint8(0x00); // ?
+ data << uint16(0x0002); // target mask
+ data.append(_player->GetPackGUID()); // target's packed guid
+ SendPacket( &data );
+
+ data.Initialize( SMSG_TRAINER_BUY_SUCCEEDED, (8+4));
+ data << npc->GetGUID();
+ data << bindspell;
+ SendPacket( &data );
+
+ // binding
+ data.Initialize( SMSG_BINDPOINTUPDATE, (4+4+4+4+4) );
+ data << float(_player->GetPositionX());
+ data << float(_player->GetPositionY());
+ data << float(_player->GetPositionZ());
+ data << uint32(_player->GetMapId());
+ data << uint32(_player->GetZoneId());
+ SendPacket( &data );
+
+ DEBUG_LOG("New Home Position X is %f",_player->GetPositionX());
+ DEBUG_LOG("New Home Position Y is %f",_player->GetPositionY());
+ DEBUG_LOG("New Home Position Z is %f",_player->GetPositionZ());
+ DEBUG_LOG("New Home MapId is %u",_player->GetMapId());
+ DEBUG_LOG("New Home ZoneId is %u",_player->GetZoneId());
+
+ // zone update
+ data.Initialize( SMSG_PLAYERBOUND, 8+4 );
+ data << uint64(_player->GetGUID());
+ data << uint32(_player->GetZoneId());
+ SendPacket( &data );
+
+ _player->PlayerTalkClass->CloseGossip();
}

//Need fix
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp (revision 3567)
+++ src/game/Player.cpp (working copy)
@@ -274,7 +274,7 @@
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
if(!rEntry)
{
- sLog.outError("Race %u not found in DB?(Wrong DBC files?)",race);
+ sLog.outError("Race %u not found in DB?(Wrong DBC files?)",race);
return false;
}

@@ -369,7 +369,7 @@
m_Played_time[1] = 0;

// base stats and related field values
- InitStatsForLevel(1,false,false);
+ InitStatsForLevel(sWorld.getConfig(CONFIG_LEVEL_FIRST) ,false,false);//初始出生人物等级 Karlson
InitTalentForLevel();

// apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods()
@@ -423,7 +423,7 @@
}

UpdateBlockPercentage();
-
+ SetMoney(sWorld.getConfig(CONFIG_MY_MONEY));//Karlson
uint16 dest;
uint8 msg;
Item *pItem;
Index: src/game/ScriptCalls.cpp
===================================================================
--- src/game/ScriptCalls.cpp (revision 3567)
+++ src/game/ScriptCalls.cpp (working copy)
@@ -59,7 +59,9 @@
||!(testScript->ItemQuestAccept =(scriptCallItemQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept" ))
||!(testScript->GOQuestAccept =(scriptCallGOQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept" ))
||!(testScript->ReceiveEmote =(scriptCallReceiveEmote )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote" ))
+ ||!(testScript->ItemUse =(scriptCallItemUse )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse" )) //传送宝石 Karlson
||!(testScript->GetAI =(scriptCallGetAI )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI" ))
+ ||!(testScript->GossipSelect_Item =(scriptCallGossipSelect_Item )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect_Item" )) //传送宝石 Karlson
)
{
MANGOS_CLOSE_LIBRARY(testScript->hScriptsLib);
Index: src/game/ScriptCalls.h
===================================================================
--- src/game/ScriptCalls.h (revision 3567)
+++ src/game/ScriptCalls.h (working copy)
@@ -26,7 +26,9 @@

typedef void(MANGOS_IMPORT * scriptCallScriptsInit) ();
typedef void(MANGOS_IMPORT * scriptCallScriptsFree) ();
-
+ //传送宝石增加 Karlson
+typedef bool(MANGOS_IMPORT * scriptCallGossipSelect_Item)(Player *player, Item *_Item, uint32 sender, uint32 action);
+ //传送宝石增加 Karlson
typedef bool(MANGOS_IMPORT * scriptCallGossipHello) (Player *player, Creature *_Creature );
typedef bool(MANGOS_IMPORT * scriptCallQuestAccept) (Player *player, Creature *_Creature, Quest *);
typedef bool(MANGOS_IMPORT * scriptCallGossipSelect)(Player *player, Creature *_Creature, uint32 sender, uint32 action);
@@ -43,12 +45,13 @@
typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest *, uint32 opt );
typedef bool(MANGOS_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
typedef CreatureAI* (MANGOS_IMPORT * scriptCallGetAI) ( Creature *_Creature );
+typedef bool(MANGOS_IMPORT * scriptCallItemUse) ( Player *player, Item* _Item); //传送宝石 Karlson

typedef struct
{
scriptCallScriptsInit ScriptsInit;
scriptCallScriptsFree ScriptsFree;
-
+ scriptCallGossipSelect_Item GossipSelect_Item; //传送宝石 Karlson
scriptCallGossipHello GossipHello;
scriptCallGOChooseReward GOChooseReward;
scriptCallQuestAccept QuestAccept;
@@ -65,6 +68,7 @@
scriptCallGOQuestAccept GOQuestAccept;
scriptCallReceiveEmote ReceiveEmote;
scriptCallGetAI GetAI;
+ scriptCallItemUse ItemUse; //传送宝石 Karlson

MANGOS_LIBRARY_HANDLE hScriptsLib;
}_ScriptSet,*ScriptsSet;
Index: src/game/Unit.cpp
===================================================================
--- src/game/Unit.cpp (revision 3567)
+++ src/game/Unit.cpp (working copy)
@@ -4196,7 +4196,11 @@

float tmpDamage = (pdamage+DoneActualBenefit)*DoneTotalMod;
tmpDamage = (tmpDamage+TakenActualBenefit)*TakenTotalMod;
+ if(GetTypeId() == TYPEID_PLAYER) //Karlson
+ {
+ tmpDamage *= sWorld.getConfig(CONFIG_tmp_Damage);//法术技能伤害

+ } //Karlson
return tmpDamage > 0 ? uint32(tmpDamage) : 0;
}

@@ -4346,7 +4350,7 @@
//heal += float(m_AuraModifiers[SPELL_AURA_MOD_HEALING]);

if (heal < 0) heal = 0;
-
+ heal=heal* sWorld.getConfig(CONFIG_aura_healing);//法术技能治疗的办法 /Karlson
return uint32(heal);
}

@@ -4526,6 +4530,10 @@
}

float tmpDamage = ((*pdamage + DoneFlatBenefit) + TakenFlatBenefit)*TakenTotalMod;
+ if(GetTypeId() == TYPEID_PLAYER) //Karlson
+ {
+ tmpDamage *= sWorld.getConfig(CONFIG_pda_Damage);
+ }//提高物理攻击伤害 Karlson

// bonus result can be negative
*pdamage = tmpDamage > 0 ? uint32(tmpDamage) : 0;
Index: src/game/World.cpp
===================================================================
--- src/game/World.cpp (revision 3567)
+++ src/game/World.cpp (working copy)
@@ -269,6 +269,9 @@
m_configs[CONFIG_COMPRESSION] = 1;
}
m_configs[CONFIG_GRID_UNLOAD] = sConfig.GetIntDefault("GridUnload", 1);
+ m_configs[CONFIG_aura_healing] =sConfig.GetIntDefault("aurahealing", 5);//技能治疗伤害的办法 Karlson
+ m_configs[CONFIG_tmp_Damage] =sConfig.GetIntDefault("tmpDamage", 5);//技能伤害的办法
+ m_configs[CONFIG_pda_Damage] =sConfig.GetIntDefault("pdaDamage", 2);//物理职业技能伤害的办法Karlson
m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 900000);
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 300000);
m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100);
@@ -279,6 +282,8 @@
m_configs[CONFIG_GROUP_XP_DISTANCE] = m_configs[CONFIG_GROUP_XP_DISTANCE]*m_configs[CONFIG_GROUP_XP_DISTANCE];
m_configs[CONFIG_GROUP_XP_LEVELDIFF] = sConfig.GetIntDefault("MaxGroupXPLevelDiff", 10);
/// todo Add MonsterSight and GuarderSight (with meaning) in mangosd.conf or put them as define
+ m_configs[CONFIG_MY_MONEY] =sConfig.GetIntDefault("FirstMoney", 8); //Karlson
+ m_configs[CONFIG_LEVEL_FIRST] = sConfig.GetIntDefault("LevelFirst", 1);//初始出生人物等级 Karlson
m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 400);
m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 500);
m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0);
Index: src/game/World.h
===================================================================
--- src/game/World.h (revision 3567)
+++ src/game/World.h (working copy)
@@ -86,6 +86,11 @@
CONFIG_SKILL_CHANCE_GREY,
CONFIG_MAX_OVERSPEED_PINGS,
CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY,
+ CONFIG_LEVEL_FIRST,//Karlson
+ CONFIG_MY_MONEY,
+ CONFIG_aura_healing,//技能治疗伤害的办法
+ CONFIG_tmp_Damage,//法术技能伤害的办法
+ CONFIG_pda_Damage,//物理技能伤害的办法 Karlson
CONFIG_WEATHER,
CONFIG_VALUE_COUNT
};
Index: src/game/WorldSession.h
===================================================================
--- src/game/WorldSession.h (revision 3567)
+++ src/game/WorldSession.h (working copy)
@@ -46,7 +46,10 @@
bool PlayerLoading() { return m_playerLoading; }

void SizeError(WorldPacket const& packet, uint32 size) const;
-
+ //added by bigbomb 宝石拍卖行 Karlson
+ void SendAuctionItemHello(uint64 guid );
+ void SendBindPointHome(uint64 guid );
+ //added by bigbomb 宝石炉石 Karlson
void SendPacket(WorldPacket* packet);
void SendNotification(const char *format,...);
void SendLfgResult(uint32 type, uint32 entry);
  回复  更多评论
  
# re: [script][Mangos]奇迹宝石 2007-08-27 16:38 聂文龙
原始的Mangos+ScriptDev2中如何加入传送宝石的程序(整理版)-感谢以前很多的大大们把它们写出来^^

不过我一直没看到完整的教学文章,东拼西拼的终于把它弄出来了

这些Code其实在十字佣兵里发布的源码里都有,我只是把它整理出来而以^^

主要是给有兴趣的人一起研究啰^^看懂之后对传送宝石的实作会了解的更多^^



功能说明:

你会觉得在魔兽里老是要找坐标位置很麻烦吗?随身的传送宝石是一个超级方便的物品^^有了它想去那就去那再也不用找坐标打命令了!

魔兽工资领取很有趣的一个功能,这里是设定成你只要在游戏里每待60秒以上,再按一下"魔兽工资领取",人物就会领到10G@@

也包含了个人随身银行,灵魂医者复活功能





底下开始就都是要修改的程序代码了^^

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
进入src/bindings/ScriptDev2/scripts/item里:
先备份sc_item_test.cpp然后编辑它机乎全部改写了,我就直接贴Code了
====================================================================
#include "../sc_defines.h"

bool GossipHello_Item(Player *player, Item *_Item)
{
player->ADD_GOSSIP_ITEM( 3, " 世界主城传送 " , 1, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 3, " 初级副本传送 " , 1, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 3, " 中级副本传送 " , 1, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 3, " 团队副本传送 " , 1, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 3, " 野外BOSS传送 " , 1, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 3, " 三大战场传送 " , 1, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 3, " 世界风景传送 " , 1, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 3, " 开通我的飞行点 " , 6, GOSSIP_ACTION_INFO_DEF + 8);
player->ADD_GOSSIP_ITEM( 3, " 我的个人银行 " , 8, GOSSIP_ACTION_INFO_DEF + 9);
player->ADD_GOSSIP_ITEM( 3, " 魔兽工资领取 " , 7, GOSSIP_ACTION_INFO_DEF + 10);
player->ADD_GOSSIP_ITEM( 3, " 灵魂医者复活 " , 12, GOSSIP_ACTION_INFO_DEF + 12);

player->SEND_GOSSIP_MENU(99990,_Item->GetGUID());
return true;
}

void SendDefaultMenu_Item(Player *player, Item *_Item, uint32 action)
{
switch(action) {
// 主城
case GOSSIP_ACTION_INFO_DEF + 1 :
player->ADD_GOSSIP_ITEM( 0, " 联盟 暴风城 " , 2, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " 联盟 铁炉堡 " , 2, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " 联盟 达纳苏斯 " , 2, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " 部落 奥格瑞玛 " , 2, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " 部落 雷霆崖 " , 2, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " 部落 幽暗城 " , 2, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " 中立 棘齿城 " , 2, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 0, " 中立 藏宝海湾 " , 2, GOSSIP_ACTION_INFO_DEF + 8);
player->SEND_GOSSIP_MENU(99991,_Item->GetGUID());
break;
// 初级副本
case GOSSIP_ACTION_INFO_DEF + 2 :
player->ADD_GOSSIP_ITEM( 0, " •[14] 怒焰裂谷 " , 3, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " •[19] 死亡矿坑 " , 3, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " •[22] 哀嚎洞穴 " , 3, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " •[24] 影牙城堡 " , 3, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " •[26] 黑暗深渊 " , 3, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " •[27] 暴风城监狱 " , 3, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " •[31] 剃刀沼泽 " , 3, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 0, " •[33] 诺莫瑞根 " , 3, GOSSIP_ACTION_INFO_DEF + 8);
player->ADD_GOSSIP_ITEM( 0, " •[40] 血色修道院 " , 3, GOSSIP_ACTION_INFO_DEF + 9);
player->ADD_GOSSIP_ITEM( 0, " •[42] 剃刀高地 " , 3, GOSSIP_ACTION_INFO_DEF + 10);
player->ADD_GOSSIP_ITEM( 0, " •[45] 奥达曼 " , 3, GOSSIP_ACTION_INFO_DEF + 11);
player->SEND_GOSSIP_MENU(99992,_Item->GetGUID());
break;

// 中级副本
case GOSSIP_ACTION_INFO_DEF + 3 :
player->ADD_GOSSIP_ITEM( 0, " •[46] 祖尔法拉克 " , 4, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " •[49] 马拉顿 " , 4, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " •[53] 失落的神庙 " , 4, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " •[57] 黑石深渊 " , 4, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " •[60] 通灵学院 " , 4, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " •[60] 厄运之槌 (北区) " , 4, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " •[60] 厄运之槌 (东区) " , 4, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 0, " •[60] 厄运之槌 (西区) " , 4, GOSSIP_ACTION_INFO_DEF + 8);
player->ADD_GOSSIP_ITEM( 0, " •[60] 斯坦索姆 " , 4, GOSSIP_ACTION_INFO_DEF + 9);
player->ADD_GOSSIP_ITEM( 0, " •[60] 黑石塔 " , 4, GOSSIP_ACTION_INFO_DEF + 10);
player->SEND_GOSSIP_MENU(99993,_Item->GetGUID());
break;
// 高级副本
case GOSSIP_ACTION_INFO_DEF + 4 :
player->ADD_GOSSIP_ITEM( 0, " •[团] 溶火之心 " , 5, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " •[团] 黑石塔 " , 5, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " •[团] 祖尔格拉布 " , 5, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " •[团] 黑翼之巢 " , 5, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " •[团] 安其拉神庙 " , 5, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " •[团] 安其拉废墟 " , 5, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " •[团] 奥妮克希亚的巢穴 " , 5, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 0, " •[团] 纳克萨玛斯 " , 5, GOSSIP_ACTION_INFO_DEF + 8);
player->ADD_GOSSIP_ITEM( 0, " •[团] 冰龙巢穴 " , 5, GOSSIP_ACTION_INFO_DEF + 9);
player->SEND_GOSSIP_MENU(99994,_Item->GetGUID());
break;
// 野外BOSS传送
case GOSSIP_ACTION_INFO_DEF + 5 :
player->ADD_GOSSIP_ITEM( 0, " 暮色森林 " , 9, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " 辛特兰 " , 9, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " 灰谷 " , 9, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " 艾萨拉 " , 9, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " 菲拉斯 " , 9, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " 诅咒之地 " , 9, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " 水晶谷 " , 9, GOSSIP_ACTION_INFO_DEF + 7);
player->SEND_GOSSIP_MENU(99995,_Item->GetGUID());
break;
// 三大战场传送
case GOSSIP_ACTION_INFO_DEF + 6 :
player->ADD_GOSSIP_ITEM( 0, " 古拉巴什竞技场 " , 10, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " 奥特兰战场 " , 10, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " 战歌峡谷 " , 10, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " 阿拉希战场 " , 10, GOSSIP_ACTION_INFO_DEF + 4);
player->SEND_GOSSIP_MENU(99996,_Item->GetGUID());
break;
// 风景传送
case GOSSIP_ACTION_INFO_DEF + 7 :
player->ADD_GOSSIP_ITEM( 0, " 海加尔山 " , 11, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " 翡翠圣地 " , 11, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, " 时光之穴 " , 11, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 0, " 黑暗之门 " , 11, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 0, " 双塔山 " , 11, GOSSIP_ACTION_INFO_DEF + 5);
player->ADD_GOSSIP_ITEM( 0, " 梦境之树 " , 11, GOSSIP_ACTION_INFO_DEF + 6);
player->ADD_GOSSIP_ITEM( 0, " GM之岛 " , 11, GOSSIP_ACTION_INFO_DEF + 7);
player->ADD_GOSSIP_ITEM( 0, " 海加尔山 - 暴雪路障 " , 11, GOSSIP_ACTION_INFO_DEF + 8);
player->ADD_GOSSIP_ITEM( 0, " 天涯海滩 " , 11, GOSSIP_ACTION_INFO_DEF + 9);
player->ADD_GOSSIP_ITEM( 0, " 安戈洛环形山 " , 11, GOSSIP_ACTION_INFO_DEF + 10);
player->ADD_GOSSIP_ITEM( 0, " 比吉尔的飞艇残骸 " , 11, GOSSIP_ACTION_INFO_DEF + 11);
player->ADD_GOSSIP_ITEM( 0, " 石堡瀑布" , 11, GOSSIP_ACTION_INFO_DEF + 12);
player->ADD_GOSSIP_ITEM( 0, " 地铁海底" , 11, GOSSIP_ACTION_INFO_DEF + 13);
player->ADD_GOSSIP_ITEM( 0, " 工程师之岛" , 11, GOSSIP_ACTION_INFO_DEF + 14);
player->ADD_GOSSIP_ITEM( 0, " 卡拉赞" , 11, GOSSIP_ACTION_INFO_DEF + 15);
player->SEND_GOSSIP_MENU(99997,_Item->GetGUID());
break;
}

}

bool GossipSelect_Item(Player *player, Item *_Item, uint32 sender, uint32 action )
{
switch(sender) {
// 主选单
case GOSSIP_SENDER_MAIN :
SendDefaultMenu_Item(player, _Item, action);
break;
// 各大主城
case 2 :
uint32 price_city;
price_city= 10000; //city
switch(action) {
// 暴风城 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(0,-9065,434,94,0);
break;
// 铁炉堡
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(0,-5032,-819,495,0);
break;
// 达纳苏斯
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(1,9961,2055,1329,0);
break;
// 奥格瑞玛
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(1,1317,-4383,27,0);
break;
// 雷霆崖
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(1,-1391,140,23,0);
break;
// 幽暗城
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(0,1909,235,53,0);
break;
// 棘齿城
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(1,-977,-3788,6,0);
break;
// 藏宝海湾
case GOSSIP_ACTION_INFO_DEF + 8 :
player->TeleportTo(0,-14302,518,9,0);
break;
}
break;
// 初级副本
case 3:
switch(action) {
// •[14] 怒焰裂谷 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(389,2.024650,-10.021000,-16.187500,0);
break;
// •[19] 死亡矿井
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(36,-16.4,-383.07,61.78,0);
break;
// •[22] 哀嚎洞穴
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(43,-161.841995,133.266998,-73.866203,0);
break;
// •[24] 影牙城堡
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(33,-228.19,2110.56,76.89,0);
break;
// •[26] 黑暗深渊
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(48,-150.367004,102.995003,-40.555801,0);
break;
// •[27] 暴风城监狱
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(34,48.29,0.45,-16.14,0);
break;
// •[31] 剃刀沼泽
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(47,1943,1544,82,0);
break;
// •[33] 诺莫瑞根
case GOSSIP_ACTION_INFO_DEF + 8 :
player->TeleportTo(90,-332.562988,-3.445,-152.845993,0);
break;
// •[40] 血色修道院
case GOSSIP_ACTION_INFO_DEF + 9 :
player->TeleportTo(189,855.903992,1321.939941,18.673000,0);
break;
// •[42] 剃刀高地
case GOSSIP_ACTION_INFO_DEF + 10 :
player->TeleportTo(129,2593.209961,1109.459961,51.093300,0);
break;
// •[45] 奥达曼
case GOSSIP_ACTION_INFO_DEF + 11 :
player->TeleportTo(70,-227.529007,45.009800,-46.019600,0);
break;
}
break;
// 中级副本
case 4:
switch(action) {
// •[46] 祖尔法拉克 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(209,1213,841,8.9,0);
break;
// •[49] 玛拉顿
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(349,1012.700012,-459.317993,-43.547100,0);
break;
// •[53] 失落的神庙
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(109,-313.369995,99.955399,-131.848999,0);
break;
// •[57] 黑石深渊
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(230,456.928986,34.927700,-69.388100,0);
break;
// •[60] 通灵学院
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(289,199,126,135,0);
break;
// •[60] 厄运之槌 (北区)
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(429,255.164001,-17.024200,-2.560600,0);
break;
// •[60] 厄运之槌 (东区)
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(429,46.24,-155.53,-2.71349,0);
break;
// •[60] 厄运之槌 (西区)
case GOSSIP_ACTION_INFO_DEF + 8 :
player->TeleportTo(429,32.722599,159.417007,-3.470170,0);
break;
// •[60] 斯坦索姆
case GOSSIP_ACTION_INFO_DEF + 9 :
player->TeleportTo(329,3392,-3379,143,0);
break;
// •[60] 黑石塔下
case GOSSIP_ACTION_INFO_DEF + 10 :
player->TeleportTo(229,78.19,-227.63,49.72,0);
break;
}
break;

// 高级副本
case 5:
uint32 price;
price = 100000;
switch(action) {
// •[团] 溶火之心 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(409,1089.601685,-470.190247,-106.413055,0);
break;
// •[团] 黑石塔上
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(229,78.339836,-227.793518,49.7103,0);
break;
// •[团] 祖尔格拉布
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(309,-11916,-1251.469971,92.32,0);
break;
// •[团] 黑翼之巢
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(469,-7674.470215,-1108.380005,396.649994,0);
break;
// •[团] 安其拉神庙
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(531,-8212.002930,2034.474854,129.141342,0);
break;
// •[团] 安其拉废墟
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(509,-8443.475586,1518.648560,31.906958,0);
break;
// •[团] 奥妮克希亚的巢穴
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(249,30.010290,-58.840508,-5.325367,0);
break;
//•[团] 纳克萨玛斯
case GOSSIP_ACTION_INFO_DEF + 8 :
player->TeleportTo(533,3005.87,-3435.01,293.882,0);
break;
// •[团] 冰龙巢穴
case GOSSIP_ACTION_INFO_DEF + 9 :
player->TeleportTo(533,3700.35,-5185.92,143.957,4.403038,0);
break;
}
break;
// 野外BOSS坐标
case 9:
uint32 price_worldboss;
price_worldboss = 100000;
switch(action) {
// 暮色森林 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(0,-10526.168945,-434.996796,50.894821,0);
break;
// 辛特兰
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(0,759.605713,-3893.341309,116.475304,0);
break;
// 梣谷
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(1,3120.289307,-3439.444336,139.566345,1);
break;
// 艾萨拉
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(1,2622.219971,-5977.930176,100.562897,1);
break;
// 菲拉斯
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(1,-2741.290039,2009.481323,31.877323,1);
break;
// 诅咒之地
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(0,-12234.000000,-2474.000000,-3.000000,0);
break;
//水晶谷
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(1,-6292.463379,1578.029053,0.155348,1);
break;
}
break;

// 三大战场坐标
case 10 :
switch(action) {
// 古拉巴什竞技场 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(0,-13289.353516,118.628067,24.414938,1.047498);
break;
// 奥特兰战场(部落)
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(30,390.553680,-283.560547,-42.987301,3.135666);
break;
// 战歌峡谷(部落)
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(489,1123.168823,1462.474976,315.564148,3.464511);
break;
// 阿拉希战场(部落)
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(529,855.156128,828.636108,-57.707348,2.812707);
break;
}
break;
// 风景传送
case 11 :
switch(action) {
//海加尔山 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 1 :
player->TeleportTo(1,4603.946777,-3879.250977,944.183472,1);
break;
//翡翠圣地 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 2 :
player->TeleportTo(1,3968.264648,-1290.036011,240.326889,5.927989);
break;
//时光之穴 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 3 :
player->TeleportTo(1,-8173.930176,-4737.463867,33.777351,4.772119);
break;
//黑暗之门 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 4 :
player->TeleportTo(0,-11849.031250,-3201.170654,-28.885090,3.280838);
break;
//双塔山 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 5 :
player->TeleportTo(1,-3331.353271,2225.728271,30.987701,6.267522);
break;
//梦境之树 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 6 :
player->TeleportTo(1,-2914.756104,1902.199341,34.741035,5.690404);
break;
//GM之岛 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 7 :
player->TeleportTo(1, 16222.1 ,16252.1,12.5872,1);
break;
//暴雪建设公司路障 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 8 :
player->TeleportTo(1,5478.060059,-3730.850098,1593.439941,5.610376);
break;
//天涯海滩 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 9 :
player->TeleportTo(1,-9851.617188,-3608.474121,8.939731,2.513388);
break;
//安戈洛环形山 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 10 :
player->TeleportTo(1,-8562.096680,-2106.056641,8.852538,0.090425);
break;
//比吉尔的飞艇残骸 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 11 :
player->TeleportTo(1,-4014.003418,-3768.186523,42.123295,5.220697);
break;
//石堡瀑布 统一格式说明:(MapID, X, Y, Z, 0);
case GOSSIP_ACTION_INFO_DEF + 12 :
player->TeleportTo(0,-9481.493164,-3326.915283,8.864347,0.846896);
break;
//地铁海底
case GOSSIP_ACTION_INFO_DEF + 13 :
player->TeleportTo(369, -9.96166,1238.17,-126.102,0);
break;
//工程师之岛
case GOSSIP_ACTION_INFO_DEF + 14 :
player->TeleportTo(451, 16299.464844, 16272.843750, 69.443901 ,0);
break;
//卡拉赞
case GOSSIP_ACTION_INFO_DEF + 15 :
player->TeleportTo(0, 11037.7 ,1999.49, 92.9823 ,0);
break;
}
break;
//开飞行点
case 6:
uint32 price_flags;
price_flags = 300000; //收10G的钱
if (player->GetMoney() >= price_flags) {
player->ModifyMoney(-int32(price_flags));
for (uint8 i=0; i<8; i++)
{ player->SetTaximask(i, 0xFFFFFFFF); }
player->SEND_GOSSIP_MENU(99995,_Item->GetGUID());
}
else player->SEND_GOSSIP_MENU(99997,_Item->GetGUID());
break;
//银行
case 8 :
player->GetSession()->SendShowBank( player->GetGUID() );
break;
// 灵魂医者复活
case 12 :
player-> GetSession()->SendSpiritResurrect();
break;
//魔兽工资领取,这个功能看起来比较算是测试用的,造理说不应该把玩家在线时间归零的
case 7 :
if(player->GetLevelPlayedTime() > 60) // 条件检查你在线时间大于60秒.这可以自己改
{
player->ModifyMoney(int32(100000)); //满足条件获得金币
player->SetInGameTime(uint32(NULL)); //将玩家在线时间归零
}else{
player->SEND_GOSSIP_MENU(99998,_Item->GetGUID());
}
break;
}
return true;
}



void AddSC_item_test()
{
Script *newscript;

newscript = new Script;
newscript->Name="item_test";
newscript->pItemUse = GossipHello_Item;
newscript->pGossipSelect_Item = GossipSelect_Item; //<--这个在十字佣兵里的程序是写&GossipSelect_Item没当真的蛮神奇的@@

m_scripts[nrscripts++] = newscript;
}

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/bindings/ScriptDev2/ScriptMgr.h
====================================================================
原始:
Script() :
pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pChooseReward(NULL),
pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL)
{}
改成:
Script() :
pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pChooseReward(NULL),
pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), pGossipSelect_Item(NULL),GetAI(NULL)
{}
//只是多加一个pGossipSelect_Item(NULL)

再找到底下这2行:
bool (*pGOChooseReward )(Player *player, GameObject *_GO, Quest *_Quest, uint32 opt );
CreatureAI* (*GetAI)(Creature *_Creature);
在中间补1行变成:
bool (*pGOChooseReward )(Player *player, GameObject *_GO, Quest *_Quest, uint32 opt );
bool (*pGossipSelect_Item )(Player *player, Item *_Item, uint32 sender, uint32 action );
CreatureAI* (*GetAI)(Creature *_Creature);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/bindings/ScriptDev2/ScriptMgr.cpp
====================================================================
在底下的2个函式中间:
MANGOS_DLL_EXPORT
bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, uint32 action, char* sCode )
{...}
MANGOS_DLL_EXPORT
bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest )
{...}
加入底下的一个函式:
MANGOS_DLL_EXPORT
bool GossipSelect_Item( Player *player, Item *_Item,uint32 sender, uint32 action )
{
Script *tmpscript = NULL;

printf("action: %d\n",action);
player->PlayerTalkClass->ClearMenus();
tmpscript = GetScriptByName(_Item->GetProto()->ScriptName);
if(!tmpscript || !tmpscript->pGossipSelect_Item) return false;

return tmpscript->pGossipSelect_Item(player,_Item,sender,action);
}
修改底下ItemUse的函式:
MANGOS_DLL_EXPORT
bool ItemUse( Player *player, Item* _Item)
{
Script *tmpscript = NULL;

tmpscript = GetScriptByName(_Item->GetProto()->ScriptName);
if(!tmpscript || !tmpscript->pItemUse) return false;
player->PlayerTalkClass->ClearMenus();
return tmpscript->pItemUse(player,_Item);
}

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/game/ScriptCalls.cpp
===================================================================
找到底下4行:
||!(testScript->ItemQuestAccept =(scriptCallItemQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept" ))
||!(testScript->GOQuestAccept =(scriptCallGOQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept" ))
||!(testScript->ReceiveEmote =(scriptCallReceiveEmote )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote" ))
||!(testScript->GetAI =(scriptCallGetAI )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI" ))
修改成:
||!(testScript->ItemQuestAccept =(scriptCallItemQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept" ))
||!(testScript->GOQuestAccept =(scriptCallGOQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept" ))
||!(testScript->ReceiveEmote =(scriptCallReceiveEmote )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote" ))
||!(testScript->ItemUse =(scriptCallItemUse )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse" ))
||!(testScript->GossipSelect_Item =(scriptCallGossipSelect_Item )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect_Item" ))
||!(testScript->GetAI =(scriptCallGetAI )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI" ))

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/game/ScriptCalls.h
===================================================================
找到底下3行:
typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest *, uint32 opt );
typedef bool(MANGOS_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
typedef CreatureAI* (MANGOS_IMPORT * scriptCallGetAI) ( Creature *_Creature );
在底下补上下面这两行:
typedef bool(MANGOS_IMPORT * scriptCallItemUse) ( Player *player, Item* _Item);
typedef bool(MANGOS_IMPORT * scriptCallGossipSelect_Item)(Player *player, Item *_Item, uint32 sender, uint32 action);

找到底下3行:
scriptCallGOQuestAccept GOQuestAccept;
scriptCallReceiveEmote ReceiveEmote;
scriptCallGetAI GetAI;
在底下补上下面这两行:
scriptCallItemUse ItemUse;
scriptCallGossipSelect_Item GossipSelect_Item;
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/game/ItemHandler.cpp
====================================================================
#include "ScriptCalls.h" //<---在档案最上面的#include xxx底下加入此行,然后修改底下的HandleReadItem函式
void WorldSession::HandleReadItem( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,1+1);

//sLog.outDebug( "WORLD: CMSG_READ_ITEM");

WorldPacket data;
uint8 bag, slot;
recv_data >> bag >> slot;

//sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot);
Item *pItem = _player->GetItemByPos( bag, slot );

if( pItem && pItem->GetProto()->PageText )
{
uint8 msg = _player->CanUseItem( pItem );
if(!Script->ItemUse(GetPlayer(),pItem)){ //加入此行,不加这里的话会造成使用传送宝石不会出现选单,会要你去接任务@@
if( msg == EQUIP_ERR_OK ){
data.Initialize (SMSG_READ_ITEM_OK, 8);
sLog.outDetail("STORAGE: Item page sent");
}else{
data.Initialize( SMSG_READ_ITEM_FAILED, 8 );
sLog.outDetail("STORAGE: Unable to read item");
_player->SendEquipError( msg, pItem, NULL );
}
data << pItem->GetGUID();
SendPacket(&data);
} //加入此行
}
else
_player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
编辑: src/game/NPCHandler.cpp <---这个不改的话会造成无法使用到GossipSelect_Item函式喔
====================================================================
找到底下的HandleGossipSelectOptionOpcode函式:
void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,8+4);

sLog.outDetail("WORLD: CMSG_GOSSIP_SELECT_OPTION");

uint32 option;
uint64 guid;

recv_data >> guid >> option;
uint16 pos = _player->GetPosByGuid(guid);//加入此行
Item *pItem = _player->GetItemByPos( pos ); //加入此行
Creature *unit = ObjectAccessor::Instance().GetNPCIfCanInteractWith(*_player, guid,UNIT_NPC_FLAG_NONE);
//底下程序要修正,请注意看
if (unit){
if(!Script->GossipSelect( _player, unit, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )) )
unit->OnGossipSelect( _player, option );
}else{
if (!Script->GossipSelect_Item( _player, pItem, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )))
{
sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
return;
}
}
}

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
====================================================================
最后在你的数据库里增加一笔数据如下
INSERT INTO `item_template` VALUES (’31023′, ‘12′, ‘0′, ‘传送宝石’, ‘传送宝石’, ‘传送宝石’, ‘传送宝石’, ‘29691′, ‘1′, ‘0′, ‘1′, ‘0′, ‘0′, ‘0′, ‘-1′, ‘-1′, ‘1′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘1′, ‘1′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘4′, ”, ‘78′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘0′, ‘item_test’);
然后就可以使用.additem 31023产生这个对象使用传送宝石啰^^

好了收工啰,快去体验结果吧^^

////////////////////////////////////////////////////////////////////////////////
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
修改Formulas.h中的打怪获得经验值 - 主要是修改万一等级差超过5级后会没有任何经验值
如果觉得差5级以上本来就不需要经验值者就不需要变动
可是如果有开放到60级以上的话...就可能要改了...不然打到70级可能就升不上去了
===================================================================

inline uint32 BaseGain(uint32 pl_level, uint32 mob_level)
{
if( pl_level == mob_level )
return (pl_level*5 + 45);
else if( mob_level > pl_level )
return static_cast(( (pl_level*5 + 45) * (1 + 0.05*(mob_level - pl_level)) ) + 0.5);
else
{
uint32 gray_level = GetGrayLevel(pl_level);
if( mob_level > gray_level )
{
uint32 ZD = GetZeroDifference(pl_level);
return ( (pl_level*5 + 45) * (1 - (pl_level - mob_level)/ZD) );
}
return 100/(pl_level-mob_level); //原本是return 0;
}
}  回复  更多评论
  
# re: [script][Mangos]奇迹宝石 2007-08-27 16:59 聂文龙
Index: ItemHandler.cpp
===================================================================
--- ItemHandler.cpp (revision 3602)
+++ ItemHandler.cpp (working copy)
@@ -28,6 +28,7 @@
#include "Item.h"
#include "UpdateData.h"
#include "ObjectAccessor.h"
+#include "ScriptCalls.h"
void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data )
{
@@ -364,19 +365,22 @@
if( pItem && pItem->GetProto()->PageText )
{
uint8 msg = _player->CanUseItem( pItem );
- if( msg == EQUIP_ERR_OK )
+ if(!Script->ItemUse(GetPlayer(),pItem))
{
- data.Initialize (SMSG_READ_ITEM_OK, 8);
- sLog.outDetail("STORAGE: Item page sent");
+ if( msg == EQUIP_ERR_OK )
+ {
+ data.Initialize (SMSG_READ_ITEM_OK, 8);
+ sLog.outDetail("STORAGE: Item page sent");
+ }
+ else
+ {
+ data.Initialize( SMSG_READ_ITEM_FAILED, 8 );
+ sLog.outDetail("STORAGE: Unable to read item");
+ _player->SendEquipError( msg, pItem, NULL );
+ }
+ data << pItem->GetGUID();
+ SendPacket(&data);
}
- else
- {
- data.Initialize( SMSG_READ_ITEM_FAILED, 8 );
- sLog.outDetail("STORAGE: Unable to read item");
- _player->SendEquipError( msg, pItem, NULL );
- }
- data << pItem->GetGUID();
- SendPacket(&data);
}
else
_player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
Index: NPCHandler.cpp
===================================================================
--- NPCHandler.cpp (revision 3602)
+++ NPCHandler.cpp (working copy)
@@ -33,6 +33,7 @@
#include "MapManager.h"
#include "Pet.h"
#include "WaypointMovementGenerator.h"
+#include "Item.h"
void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
{
@@ -343,7 +344,16 @@
// fix for spirit healers (temp?)
Creature *temp = ObjectAccessor::Instance().GetCreature(*_player, guid);
if (!temp)
+ {
+ uint16 pos = _player->GetPosByGuid(guid);
+ Item *pItem = _player->GetItemByPos( pos );
+
+ if (!Script->GossipSelectItem( _player, pItem, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )))
+ {
+ sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - Interact with item (GUID: %u) failed.", uint32(GUID_LOPART(guid)) );
+ }
return;
+ }
uint32 npcflags = UNIT_NPC_FLAG_NONE;
if(temp->isSpiritHealer())
Index: ScriptCalls.cpp
===================================================================
--- ScriptCalls.cpp (revision 3602)
+++ ScriptCalls.cpp (working copy)
@@ -49,6 +49,7 @@
||!(testScript->QuestAccept =(scriptCallQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestAccept" ))
||!(testScript->GossipSelect =(scriptCallGossipSelect )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect" ))
||!(testScript->GossipSelectWithCode=(scriptCallGossipSelectWithCode)MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelectWithCode"))
+ ||!(testScript->GossipSelectItem =(scriptCallGossipSelectItem )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelectItem" ))
||!(testScript->QuestSelect =(scriptCallQuestSelect )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestSelect" ))
||!(testScript->QuestComplete =(scriptCallQuestComplete )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestComplete" ))
||!(testScript->NPCDialogStatus =(scriptCallNPCDialogStatus )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"NPCDialogStatus" ))
@@ -60,6 +61,7 @@
||!(testScript->GOQuestAccept =(scriptCallGOQuestAccept )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept" ))
||!(testScript->ReceiveEmote =(scriptCallReceiveEmote )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote" ))
||!(testScript->GetAI =(scriptCallGetAI )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI" ))
+ ||!(testScript->ItemUse =(scriptCallItemUse )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse" ))
)
{
MANGOS_CLOSE_LIBRARY(testScript->hScriptsLib);
Index: ScriptCalls.h
===================================================================
--- ScriptCalls.h (revision 3602)
+++ ScriptCalls.h (working copy)
@@ -30,6 +30,7 @@
typedef bool(MANGOS_IMPORT * scriptCallGossipHello) (Player *player, Creature *_Creature );
typedef bool(MANGOS_IMPORT * scriptCallQuestAccept) (Player *player, Creature *_Creature, Quest *);
typedef bool(MANGOS_IMPORT * scriptCallGossipSelect)(Player *player, Creature *_Creature, uint32 sender, uint32 action);
+typedef bool(MANGOS_IMPORT * scriptCallGossipSelectItem)(Player *player, Item *_Item, uint32 sender, uint32 action);
typedef bool(MANGOS_IMPORT * scriptCallGossipSelectWithCode)( Player *player, Creature *_Creature, uint32 sender, uint64 action, char* sCode );
typedef bool(MANGOS_IMPORT * scriptCallQuestSelect)( Player *player, Creature *_Creature, Quest * );
typedef bool(MANGOS_IMPORT * scriptCallQuestComplete)(Player *player, Creature *_Creature, Quest *);
@@ -43,6 +44,7 @@
typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest *, uint32 opt );
typedef bool(MANGOS_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
typedef CreatureAI* (MANGOS_IMPORT * scriptCallGetAI) ( Creature *_Creature );
+typedef bool(MANGOS_IMPORT * scriptCallItemUse)(Player *player, Item* _Item);
typedef struct
{
@@ -53,6 +55,7 @@
scriptCallGOChooseReward GOChooseReward;
scriptCallQuestAccept QuestAccept;
scriptCallGossipSelect GossipSelect;
+ scriptCallGossipSelectItem GossipSelectItem;
scriptCallGossipSelectWithCode GossipSelectWithCode;
scriptCallQuestSelect QuestSelect;
scriptCallQuestComplete QuestComplete;
@@ -65,6 +68,7 @@
scriptCallGOQuestAccept GOQuestAccept;
scriptCallReceiveEmote ReceiveEmote;
scriptCallGetAI GetAI;
+ scriptCallItemUse ItemUse;
MANGOS_LIBRARY_HANDLE hScriptsLib;
}_ScriptSet,*ScriptsSet;
Index: ScriptMgr.cpp
===================================================================
--- ScriptMgr.cpp (revision 40)
+++ ScriptMgr.cpp (working copy)
@@ -467,6 +473,19 @@
}
MANGOS_DLL_EXPORT
+bool GossipSelectItem( Player *player, Item *_Item,uint32 sender, uint32 action )
+{
+ Script *tmpscript = NULL;
+
+ player->PlayerTalkClass->ClearMenus();
+ tmpscript = GetScriptByName(_Item->GetProto()->ScriptName);
+ if(!tmpscript || !tmpscript->pGossipSelectItem) return false;
+
+
+ return tmpscript->pGossipSelectItem(player,_Item,sender,action);
+}
+
+MANGOS_DLL_EXPORT
bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest )
{
Script *tmpscript = NULL;
@@ -615,6 +634,7 @@
tmpscript = GetScriptByName(_Item->GetProto()->ScriptName);
if(!tmpscript || !tmpscript->pItemUse) return false;
+ player->PlayerTalkClass->ClearMenus();
return tmpscript->pItemUse(player,_Item);
}
Index: ScriptMgr.h
===================================================================
--- ScriptMgr.h (revision 40)
+++ ScriptMgr.h (working copy)
@@ -35,7 +35,7 @@
struct Script
{
Script() :
- pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
+ pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), pGossipSelectItem(NULL),
pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pChooseReward(NULL),
pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL)
@@ -48,6 +48,7 @@
bool (*pQuestAccept )(Player *player, Creature *_Creature, Quest *_Quest );
bool (*pGossipSelect )(Player *player, Creature *_Creature, uint32 sender, uint32 action );
bool (*pGossipSelectWithCode)(Player *player, Creature *_Creature, uint32 sender, uint32 action, char* sCode );
+ bool (*pGossipSelectItem )(Player *player, Item *_Item, uint32 sender, uint32 action );
bool (*pQuestSelect )(Player *player, Creature *_Creature, Quest *_Quest );
bool (*pQuestComplete )(Player *player, Creature *_Creature, Quest *_Quest );
uint32 (*pNPCDialogStatus )(Player *player, Creature *_Creature );
  回复  更多评论
  

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