Summons killing each other?

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 23, 2009
Messages
24
Reaction score
0
Hi, I'm currently using v81 irose server and the summons such as firegon, phantom swords, elementals attack each other when I summon 2 and click on either one of them o.O

Is there any way to fix this by adding if else cases in World Server to make exceptions to these summoned mobs?
 
Fate.
you aren't helping with these kind of responses.
If you can't say something useful then please don't bother replying.

Hi, I'm currently using v81 irose server and the summons such as firegon, phantom swords, elementals attack each other when I summon 2 and click on either one of them o.O

Is there any way to fix this by adding if else cases in World Server to make exceptions to these summoned mobs?

This is an issue that I haven't come across before but it is pretty closely related to one that i had to fix in osprose.
In my case if i clicked the summon it would actually attack itself.

The problem is in function void CCharacter::DoAttack( ) in battle.cpp
Since the summons are now being run on AIP functions it needs to be modified a bit.

here is a fix that should work for you.
in battle.cpp find
Code:
CMap* map = GServer->MapList.Index[Position->Map];
    switch(Battle->atktype)
    {
        case NORMAL_ATTACK:
BEFORE it add this
Code:
if(IsSummon())
    {
        CCharacter* Enemy = GetCharTarget( );
        if(Enemy == NULL && Battle->atktype != SKILL_AOE && Battle->atktype != BUFF_AOE)
        {
            //Log(MSG_DEBUG,"No Enemy found");
            ClearBattle( Battle );
            return;
        }
        if(this == Enemy) //summoned monster is attacking itself. It has been observed to happen
        {
            //Log(MSG_INFO,"Clearing Battle for this summon");
            ClearBattle( Battle );
            return;
        }
        if(Enemy->IsSummon())
        {
            CMonster* thisMonster = reinterpret_cast<CMonster*>(this);
            CMonster* otherMonster = reinterpret_cast<CMonster*>(Enemy);
            if(thisMonster->owner == otherMonster->owner)
            {
                //Log(MSG_INFO,"Clearing Battle for this summon");
                ClearBattle( Battle );
                return;                    
            }                
        }
    }
That should catch any summon trying to
1) Attack itself
2) Attack any other summon owned by the same player
In either case it will cancel their battle rather than let them attack
 
Neber~! Let's see, this makes at least 10 or more characters so I can post!

And you want me to say something useful? Fine then.. don't go outside naked, you will get arrested.. Happy?
 
Thanks Purple, that works. The summons attack each other without doing any damage =)
Well that's a start I guess.
That isn't what should happen though.
They should break off combat as soon as they start and that is what is happening server side. Seems that as far as the client is concerned though, they are still fighting till they get some other command.
Maybe we could send a packet to the client to move the summon to a new location. That would cancel the combat. Could even use its present location i guess.

i will see if i can put something together to do that and get back to you a bit later. :thumbup1:
 
Status
Not open for further replies.
Back