uint32 Unit:ealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
he->CombatStopWithPets(true);
he->DuelComplete(DUEL_INTERUPTED);
}
- // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
- if(pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->InBattleGround())
//杀怪获取MG
+if( (pVictim->GetTypeId() == TYPEID_UNIT) && player)
+{
+ //Creature *killed = ((Creature*)pVictim);
+
+ player->ModifyMG(3);//这句会让怪物的死亡效果不触发,就是假死,虽然死了,但是客户端显示的还是没死的样子
+ player->GetSession()->SendAreaTriggerMessage(_PrintfUTF8("获得MG %u",3));
+}
uint32 GetMG() { return GetUInt32Value (PLAYER_MG); }
void ModifyMG( int32 d )
{
if(d < 0)
SetMG (GetMG() > uint32(-d) ? GetMG() + d : 0);
else
SetMG ( GetMG() + d );
}
void SetMG( uint32 value )
{
SetUInt32Value (PLAYER_MG, value);//PLAYER_MG是自己扩展的属性字段
}
|
|