bool ChatHandler::HandleSetHomeCommand(const char* args) // modify by w1w
{
sDatabase.PExecute("UPDATE `character_homebind` SET `map` = '%u', `zone` = '%u', `position_x` = '%f', `position_y` = '%f', `position_z` = '%f' WHERE `guid` = '%u'", m_session->GetPlayer()->GetMapId(), m_session->GetPlayer()->GetZoneId(), m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY(), m_session->GetPlayer()->GetPositionZ(), m_session->GetPlayer()->GetGUIDLow());
m_session->GetPlayer()->m_homebindMapId = m_session->GetPlayer()->GetMapId();
m_session->GetPlayer()->m_homebindZoneId = m_session->GetPlayer()->GetZoneId();
m_session->GetPlayer()->m_homebindX = m_session->GetPlayer()->GetPositionX();
m_session->GetPlayer()->m_homebindY = m_session->GetPlayer()->GetPositionY();
m_session->GetPlayer()->m_homebindZ = m_session->GetPlayer()->GetPositionZ();
PSendSysMessage("sethome");
return true;
}
bool ChatHandler::HandleGoHomeCommand(const char* args) // modify by w1w
{
QueryResult *resultDB = sDatabase.PQuery("SELECT `position_x`,`position_y`,`position_z`,`map` FROM `character_homebind` WHERE `guid` = '%u'",m_session->GetPlayer()->GetGUIDLow());
if (!resultDB)
return false;
Field *fields;
fields = resultDB->Fetch();
float x=fields[0].GetFloat();
float y=fields[1].GetFloat();
float z=fields[2].GetFloat();
uint32 mapid=fields[3].GetUInt32();
delete resultDB;
m_session->GetPlayer()->TeleportTo(mapid, x, y, z,0.0f);
PSendSysMessage("gohome");
return true;
}
修正方法:
打开 Level3.cpp
找到 bool ChatHandler::HandleResetCommand (const char * args)
蓝色部分为添加的语句。
引用:
...
player->SetStat(STAT_STRENGTH,info->strength );
player->SetStat(STAT_AGILITY,info->agility );
player->SetStat(STAT_STAMINA,info->stamina );
player->SetStat(STAT_INTELLECT,info->intellect );
player->SetStat(STAT_SPIRIT,info->spirit );
player->SetArmor(info->basearmor );
player->SetUInt32Value(UNIT_FIELD_ATTACK_POWER, 0 );
player->SetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER, 0 ); // modify by w1w
player->SetHealth(info->health);
player->SetMaxHealth(info->health);
...
谁有空就把这个bug报告给mango吧,(...其实是我英语好烂
)
==========================================
似乎没有一个能直接添加天赋点的命令,反正我是没找到。想想10级的人物就会了全部的天赋,多好玩,那就自己加一个吧!
需要修改 chat.h, chat.cpp, level1.cpp,当然不要忘了在数据库里command表里也加上哦。
chat.h:
在class ChatHandler 的 protected 部分
引用:
bool HandleTargetObjectCommand(const char* args);
bool HandleDelObjectCommand(const char* args);
bool HandlesetTpCommand (const char* args); // modify by w1w
// shutdown server
bool ShutDown(const char* args);
bool CancelShutdown (const char* args);
chat.cpp:
static ChatCommand commandTable 里面
引用:
{ "acct", 0, &ChatHandler::HandleAcctCommand, "", NULL },
{ "setTp", 1, &ChatHandler::HandlesetTpCommand, "", NULL }, // modify by w1w
{ "addmove", 2, &ChatHandler::HandleAddMoveCommand, "", NULL },
level1.cpp:
加上下面这一段
引用:
bool ChatHandler::HandlesetTpCommand (const char* args) // modify by w1w
{
int tp = atoi((char*)args);
if (tp>0)
{
Player* player = m_session->GetPlayer();
if(!player)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
return true;
}
player->SetUInt32Value(PLAYER_CHARACTER_POINTS1, tp);
return true;
}
return false;
}
一句话,1、在chat.h里修改ChatHandler类;2、修改chat.cpp里的command列表;3、在 level1.cpp里加具体代码;4、在command表里加命令。
posted on 2007-08-27 17:11
聂文龙 阅读(1195)
评论(0) 编辑 收藏 引用 所属分类:
ascent