吾爱尚玩资源基地
标题:
魔兽世界私服:简单的修改种族并消耗物品的Trinity脚本
[打印本页]
作者:
admin
时间:
2016-4-27 23:09
标题:
魔兽世界私服:简单的修改种族并消耗物品的Trinity脚本
全部代码就在这里。大致的功能就是,当你在游戏中希望修改种族的时候,消耗掉一个物品
你可以把这个物品设置为任务物品,也可以设置为掉落物品,总之,玩家必须要拥有这个物品,就可以修改自己的种族
/* _____ ____
| ___| __ ___ _______ _ __ / ___|___ _ __ ___
| |_ | '__/ _ \_ / _ \ '_ \| | / _ \| '__/ _ \
| _|| | | (_) / / __/ | | | |__| (_) | | | __/
|_| |_| \___/___\___|_| |_|\____\___/|_| \___|
Lightning speed and strength
conjured directly from the depths of logic!
Infusion-WoW 2011 - 2013 (C)
<--------------------------------------------------------------------------->
- Developer(s): Ghostcrawler336
- Complete: %100
- ScriptName: 'Race Change Token'
- Comment: untested.
<--------------------------------------------------------------------------->
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#define item_id 44115
class item_race : public ItemScript
{
public:
item_race() : ItemScript("item_race") { }
bool OnUse(Player* player, Item* item, const SpellCastTargets &)
{
if (player->isInCombat())
{
player->GetSession()->SendNotification("You can't use this item in combat!");
return false;
}
player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '128' WHERE guid = %u", player->GetGUID());
player->GetSession()->SendNotification("Message Here");
player->DestroyItemCount(item_id, 1, true, false);
return true;
}
};
void AddSC_item_race()
{
new item_race();
}
代码就这些。。
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4