• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ anti paralyze per outfit monsters.cpp

beenii

Well-Known Member
Joined
Jul 26, 2010
Messages
580
Solutions
1
Reaction score
57
Hi, I'm trying to add immunity to paralyze when wearing an outfit.
I found the function that does it, but I don't know how to add it


Example:
Demon.lua

This line add paralize to players
Lua:
{name ="speed", interval = 2000, chance = 15, speedChange = -700, radius = 1, effect = CONST_ME_MAGIC_RED, target = true, duration = 30000}

in src monsters.cpp I found:

Code:
            if ((attr = node.attribute("speedchange"))) {
                speedChange = pugi::cast<int32_t>(attr.value());
                if (speedChange < -1000) {
                    //cant be slower than 100%
                    speedChange = -1000;
                }
            }

            ConditionType_t conditionType;
            if (speedChange > 0) {
                conditionType = CONDITION_HASTE;
                combat->setParam(COMBAT_PARAM_AGGRESSIVE, 0);
            } else {
                conditionType = CONDITION_PARALYZE;
            }

            ConditionSpeed* condition = static_cast<ConditionSpeed*>(Condition::createCondition(CONDITIONID_COMBAT, conditionType, duration, 0));
            condition->setFormulaVars(speedChange / 1000.0, 0, speedChange / 1000.0, 0);
            combat->addCondition(condition);

any way to verify, that if the player has equipped outfit id 128, don't add paralyze
 
I guess the best approach would be to make an exception at the paralyze spell and do not add the condition if the player is wearing that specific outfit
 
I guess the best approach would be to make an exception at the paralyze spell and do not add the condition if the player is wearing that specific outfit
yes, the problem is that the spell only applies to players.
the monsters will continue to paralyze
 
yes, the problem is that the spell only applies to players.
the monsters will continue to paralyze
Oh you are right, seems its in source.

Then you are in the right piece of code. That part
Lua:
conditionType = CONDITION_PARALYZE;
Is the code you need to modify. Just before that line check the player current outfit. I am not sure about the exact method, but you should have access to the player

EDIT: wait this is changing monster. Check similar thing for player...

Im on mobile, cannot check source sorry
 
Just expose managing player's condition suppressions by lua and add/remove paralyse on outfit change event
It will only remove the condition by placing the outfit.
The idea is that he is immune while wearing the outfit.
Post automatically merged:

I was checking latest TFS and could not find this piece. What version you using?

Line 361
 
Last edited:
Back
Top