吾爱尚玩资源基地
标题:
一个比较老的M端的飞行宝石代码(启发性代码)
[打印本页]
作者:
admin
时间:
2016-4-23 17:15
标题:
一个比较老的M端的飞行宝石代码(启发性代码)
这个是一个Scriptdev2的脚本代码。主要是实现一个骑乘效果的宝石代码
你可以把这个脚本加到某个物品上面。然后就可以实现菜单式的骑乘效果代码
主要是,实现给角色自身加BUFF来实现飞行,骑乘等效果
/* Copyright (C) 2006,2007 ScriptDev2 <
https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sc_gossip.h"
#include "Item.h"
#include "Player.h"
#include "SpellAuras.h"
#include "GossipDef.h"
#include "Chat.h"
bool GossipHello_ItemUse_flying_mount(Player *player, Item* _Item, SpellCastTargets const& targets)
{
player->CLEAR_GOSSIP_MENU();
if (!player->isDead() && !player->isInCombat())
{
player->ADD_GOSSIP_ITEM( 1, " |CFF0000FF【大芒果系统
WWW.MangosCn.COM
】|CFF009933 ", 1, GOSSIP_ACTION_INFO_DEF + 10);
player->ADD_GOSSIP_ITEM( 8, "【普通陆地坐骑】 普通陆地坐骑 " , 1, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 4, "【高级陆地坐骑】 高级陆地坐骑 " , 1, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 4, "【普通飞行坐骑】 普通飞行坐骑 " , 1, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM( 4, "【高级飞行坐骑】 高级飞行坐骑 " , 1, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM( 4, "【特殊最新坐骑】 特殊最新坐骑 " , 1, GOSSIP_ACTION_INFO_DEF + 5);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
return true;
}
else
{
return true;
}
}
void SendDefaultMenu_ItemUse_flying_mount(Player *player, Item *_Item, uint32 action ,SpellCastTargets const& targets)
{
switch(action) {
//【普通陆地坐骑】
case GOSSIP_ACTION_INFO_DEF + 1 :
player->ADD_GOSSIP_ITEM( 0, " ·普通坐骑1 " , 2, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " ·普通坐骑2 " , 2, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 7, "·返回上一级菜单 ", 2, GOSSIP_ACTION_INFO_DEF + 99);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
break;
//【高级陆地坐骑】
case GOSSIP_ACTION_INFO_DEF + 2 :
player->ADD_GOSSIP_ITEM( 0, " ·高级坐骑1 " , 3, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " ·高级坐骑2 " , 3, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 7, "·返回上一级菜单 ", 3, GOSSIP_ACTION_INFO_DEF + 99);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
break;
//【普通飞行坐骑】
case GOSSIP_ACTION_INFO_DEF + 3 :
player->ADD_GOSSIP_ITEM( 0, " ·普通飞行坐骑1 " , 4, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " ·普通飞行坐骑2 " , 4, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 7, "·返回上一级菜单 ", 4, GOSSIP_ACTION_INFO_DEF + 99);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
break;
//【高级飞行坐骑】
case GOSSIP_ACTION_INFO_DEF + 4 :
player->ADD_GOSSIP_ITEM( 0, " ·高级飞行坐骑1 " , 5, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " ·高级飞行坐骑2 " , 5, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 7, "·返回上一级菜单 ", 5, GOSSIP_ACTION_INFO_DEF + 99);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
break;
//【特殊最新坐骑】
case GOSSIP_ACTION_INFO_DEF + 5 :
player->ADD_GOSSIP_ITEM( 0, " ·特殊最新坐骑1 " , 6, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM( 0, " ·特殊最新坐骑2 " , 6, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 7, "·返回上一级菜单 ", 6, GOSSIP_ACTION_INFO_DEF + 99);
player->SEND_GOSSIP_MENU(999999,_Item->GetGUID());
break;
}
}
bool GossipSelect_ItemUse_flying_mount(Player *player, Item *_Item, uint32 sender, uint32 action ,SpellCastTargets const& targets)
{
int icount = 0;
//uint32 price_city;
switch(sender) {
// 主选单
case 1 :
SendDefaultMenu_ItemUse_flying_mount(player, _Item, action,targets);
break;
case 2 ://普通陆地坐骑
switch(action) {
case GOSSIP_ACTION_INFO_DEF + 1 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,34790);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets); //返回菜单
}
case GOSSIP_ACTION_INFO_DEF + 2 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,34896);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
}
break;
case GOSSIP_ACTION_INFO_DEF + 99 :
{
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
break;
}
}
break;
case 3 ://高级陆地坐骑
switch(action) {
case GOSSIP_ACTION_INFO_DEF + 1 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,39315);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets); //返回菜单
}
case GOSSIP_ACTION_INFO_DEF + 2 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,36702);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
}
break;
case GOSSIP_ACTION_INFO_DEF + 99 :
{
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
break;
}
}
break;
case 4 ://普通飞行坐骑
switch(action) {
case GOSSIP_ACTION_INFO_DEF + 1 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,32235);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets); //返回菜单
}
case GOSSIP_ACTION_INFO_DEF + 2 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,32244);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
}
break;
case GOSSIP_ACTION_INFO_DEF + 99 :
{
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
break;
}
}
break;
case 5 ://高级飞行坐骑
switch(action) {
case GOSSIP_ACTION_INFO_DEF + 1 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,37015);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets); //返回菜单
}
case GOSSIP_ACTION_INFO_DEF + 2 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,32345);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
}
break;
case GOSSIP_ACTION_INFO_DEF + 99 :
{
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
break;
}
}
break;
case 6 ://特殊最新坐骑
switch(action) {
case GOSSIP_ACTION_INFO_DEF + 1 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,34767);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets); //返回菜单
}
case GOSSIP_ACTION_INFO_DEF + 2 :
if (!player->IsMounted()) //判断是否在飞行状态
{
player->FlyingMount(player,33943);
break; //执行飞行命令
}
else
{
player->GetSession()->SendAreaTriggerMessage("你正在使用-行驶工具");
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
}
break;
case GOSSIP_ACTION_INFO_DEF + 99 :
{
GossipHello_ItemUse_flying_mount(player,_Item,targets);//返回菜单
break;
}
}
break;
}
return true;
}
void AddSC_flying_mount()
{
Script *newscript;
newscript = new Script;
newscript->Name="flying_mount";
newscript->pItemUse = GossipHello_ItemUse_flying_mount;
newscript->pGossipSelect_Item = GossipSelect_ItemUse_flying_mount;
m_scripts[nrscripts++] = newscript;
}
作者:
1314
时间:
2016-11-8 08:59
感谢楼主分享,祝愿吾爱尚玩越来越好!
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4