Subversion Repositories eoserv

Compare Revisions

Ignore whitespace Rev 357 → Rev 358

/trunk/src/map.cpp
1906,7 → 1906,7
if (!spell || (spell->type != ESF::Heal && spell->type != ESF::Damage))
return;
 
if (spell->type == ESF::Damage && from->map->pk)
if (spell->type == ESF::Damage && (from->map->pk || (this->world->config["GlobalPK"] && !this->world->PKExcept(this->id))))
{
from->tp -= spell->tp;
 
/trunk/src/character.cpp
881,7 → 881,7
switch (spell_target)
{
case TargetSelf:
if (spell->target_restrict == ESF::Opponent || spell->target != ESF::Self)
if (spell->target_restrict != ESF::Friendly || spell->target != ESF::Self)
return;
 
this->map->SpellSelf(this, spell_id);
900,11 → 900,14
break;
 
case TargetPlayer:
if ((spell->target_restrict == ESF::Opponent && !this->map->pk) || spell->target != ESF::Normal)
if (spell->target_restrict == ESF::NPCOnly || spell->target != ESF::Normal)
return;
 
victim = this->map->GetCharacterPID(spell_target_id);
 
if (spell->target_restrict != ESF::Friendly && victim == this)
return;
 
if (victim)
this->map->SpellAttackPK(this, victim, spell_id);
 
911,7 → 914,7
break;
 
case TargetGroup:
if (spell->target_restrict == ESF::Opponent || spell->target != ESF::Group)
if (spell->target_restrict != ESF::Friendly || spell->target != ESF::Group)
return;
 
this->map->SpellGroup(this, spell_id);
/trunk/src/eodata.hpp
262,7 → 262,7
 
enum TargetRestrict
{
Any,
NPCOnly,
Friendly,
Opponent
};
312,7 → 312,7
short hp;
 
ESF_Data() : id(0), icon(0), graphic(0), tp(0), sp(0), cast_time(0), type(ESF::Damage),
target_restrict(ESF::Any), target(ESF::Normal), mindam(0), maxdam(0), accuracy(0), hp(0) { }
target_restrict(ESF::NPCOnly), target(ESF::Normal), mindam(0), maxdam(0), accuracy(0), hp(0) { }
};
 
/**
/trunk/src/eodata.cpp
304,10 → 304,10
newdata->target_restrict = static_cast<ESF::TargetRestrict>(PacketProcessor::Number(buf[17]));
newdata->target = static_cast<ESF::Target>(PacketProcessor::Number(buf[18]));
 
newdata->mindam = static_cast<ESF::Target>(PacketProcessor::Number(buf[23], buf[24]));
newdata->maxdam = static_cast<ESF::Target>(PacketProcessor::Number(buf[25], buf[26]));
newdata->accuracy = static_cast<ESF::Target>(PacketProcessor::Number(buf[27], buf[28]));
newdata->hp = static_cast<ESF::Target>(PacketProcessor::Number(buf[34], buf[35]));
newdata->mindam = PacketProcessor::Number(buf[23], buf[24]);
newdata->maxdam = PacketProcessor::Number(buf[25], buf[26]);
newdata->accuracy = PacketProcessor::Number(buf[27], buf[28]);
newdata->hp = PacketProcessor::Number(buf[34], buf[35]);
 
this->data[i] = newdata;