常用使用方式:
复制内容到剪贴板
代码:
[gm命令 delmappet]
代码:
复制内容到剪贴板
代码:
//删除面前宠物
int CHAR_CHAT_DEBUG_delmappet(Char* charaptr)
{
int xout;
int yout;
API_CHAR_getCoordinationDir(charaptr->i.Dir,charaptr->i.X,charaptr->i.Y,1,&xout,&yout);
Object *object = _API_MAP_getTopObj(__FILE__, __LINE__, charaptr->i.MapId, charaptr->i.Floor, xout, yout);
if(object)
{
do
{
int objindex = object->objindex;
if(API_CHECKOBJECT(objindex))
{
if(API_OBJECT_getType(objindex) == OBJTYPE_CHARA)
{
Char* toch = API_GetCharaPtrFromCharaIndex(API_OBJECT_getIndex(objindex));
if(!API_CHAR_CheckCharPointer(toch))
{
object = object->next;
if(!object)
break;
continue;
}
if(toch->i.WhichType == CHAR_TYPEPET)
{
API_LogPet(
toch->cu.pet.OwnerCdKey,
toch->cu.pet.OwnerCharName,
toch->c.Name,
toch->cu.player.OwnTitle,
toch->i.Lv,
"Command:DelMapPet",
toch->i.MapId,
toch->i.Floor,
toch->i.X,
toch->i.Y);
char buf[128];
sprintf(buf, "面前的宠物 [%s] 已被删除。", toch->c.Name);
API_CHAR_talkToCli(charaptr, 0, msg, 0, 0);
return API_CHAR_CharaDelete(toch);
}
}
}
object = object->next;
}while(object)
}
return 1;
}
[
本帖最后由 ﹎▓ヾ僤莼べ 于 2014-4-8 09:28 编辑 ]