经有很多的功能性的NPC的Trinity-Core魔兽世界私服单机 的脚本代码。这里我在弄一个可能大家都会比较喜欢的NPC脚本代码
1、适用于怀旧魔兽私服Trinity-Core 3.3.5版本最新
2、此脚本是npc 的C++脚本,脚本名称要加到creature_template对应的NPC的脚本处
3、你需要知道如何在T端中增加对应的脚本功能
4、下面是一些该脚本的功能描述
NPC 功能包含:• 恢复血量和法力值
• 重置所有的副本进度
• 重置所有的技能冷却时间
• 重置战斗状态
• 移除虚弱状态
• 修复所有装备
• 重置天赋
• 重置所有的技能
5、SQL代码
/*
REPLACE INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES('900000','0','0','0','0','0','26867','0','0','0','Tools NPC','- by mthsena -','Speak','0','80','80','0','35','35','1','1','1.14286','2','3','0','0','0','0','1','0','0','1','0','0','0','0','0','0','0','0','0','0','0','0','4','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','3','1','1','1','1','0','0','0','0','0','0','0','0','1','0','0','Tools_NPC','1');
- Made by mthsena
*/
或则你另外选一个NPC的ID:例如 伊利丹,例如基尔加丹,这些NPC。
当然,如果是5.X.X的版本的话,。你可以考虑用用 雷神王座 的BOSS的模型什么的!这样弄起来更好看!
6、脚本C++代码:
#include "ScriptPCH.h"
class Tools_NPC : public CreatureScript
{
public:
Tools_NPC() : CreatureScript("Tools_NPC") { }
bool OnGossipHello(Player *player, Creature *creature)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Restore HP and MP", GOSSIP_SENDER_MAIN, 1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Instances", GOSSIP_SENDER_MAIN, 2);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Cooldowns", GOSSIP_SENDER_MAIN, 3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Combat", GOSSIP_SENDER_MAIN, 4);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Remove Sickness", GOSSIP_SENDER_MAIN, 5);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Repair Items", GOSSIP_SENDER_MAIN, 6);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Others...", GOSSIP_SENDER_MAIN, 7);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exit", GOSSIP_SENDER_MAIN, 8);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
return true;
}
完整代码连接地址 Tools Npc.txt
最后,增加完毕。你启动游戏。进入游戏里面。用.npc add来增加该NPC
你可以把NPC增加到你想要的区域,例如:永春台,雷电王座,魔古山宝库,......这些地方。哈哈!随便写的!!
|