吾爱尚玩资源基地

标题: 击杀BOSS后世界公告的脚本代码 [打印本页]

作者: admin    时间: 2016-4-21 23:45
标题: 击杀BOSS后世界公告的脚本代码
击杀BOSS后世界公告的脚本代码,此代码作为脚本使用。给BOSS增加脚本Boss_Announcer。然后杀死该boss就会进行世界公告一次

#include "ScriptPCH.h"

class Boss_Announcer : public PlayerScript
{
public:
Boss_Announcer() : PlayerScript ("Boss_Announcer") {}

void OnCreatureKill(Player* player, Creature* boss)
{

if (boss->isWorldBoss())
{
if (player->getGender() == GENDER_MALE)
{
char msg[250];
snprintf(msg, 250, "|CFF7BBEF7[Boss Announcer]|r:|cffff0000 %s |r and his group killed world boss |CFF18BE00[%s]|r !!!",player->GetName(),boss->GetName());
sWorld->SendServerMessage(SERVER_MSG_STRING, msg);
}
else
{
char msg[250];
snprintf(msg, 250, "|CFF7BBEF7[Boss Announcer]|r:|cffff0000 %s |r and her group killed world boss |CFF18BE00[%s]|r !!!",player->GetName(),boss->GetName());
sWorld->SendServerMessage(SERVER_MSG_STRING, msg);
}
}
}
};

void AddSC_Boss_Announcer()
{
new Boss_Announcer;
}






欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/) Powered by Discuz! X3.4