uint32Unit:ealDamage(Unit*pVictimuint32damageCleanDamageconst*cleanDa
he->CombatStopWithPets(true);
he->DuelComplete(DUEL_INTERUPTED);
}
-//battlegroundthings(dothisattheendsothedeathstateflagwillbeproperlysettohandleinthebg->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));
+}
uint32GetMG(){returnGetUInt32Value(PLAYER_MG);}
voidModifyMG(int32d)
{
if(d<0)
SetMG(GetMG()>uint32(-d)?GetMG()+d:0);
else
SetMG(GetMG()+d);
}
voidSetMG(uint32value)
{
SetUInt32Value(PLAYER_MGvalue);//PLAYER_MG是自己扩展的属性字段
}
he->CombatStopWithPets(true);
he->DuelComplete(DUEL_INTERUPTED);
}
-//battlegroundthings(dothisattheendsothedeathstateflagwillbeproperlysettohandleinthebg->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));
+}
uint32GetMG(){returnGetUInt32Value(PLAYER_MG);}
voidModifyMG(int32d)
{
if(d<0)
SetMG(GetMG()>uint32(-d)?GetMG()+d:0);
else
SetMG(GetMG()+d);
}
voidSetMG(uint32value)
{
SetUInt32Value(PLAYER_MGvalue);//PLAYER_MG是自己扩展的属性字段
}

