• 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!

TFS 1.X+ [TFS 1.3] Orc Attack Only Troll l Ignore player l Please help simple script :(

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
Help i spend 3 days on this script...


I try this is spell for troll


Code:
function onCastSpell(creature, var)
local target = Creature(var:getNumber())
print(target)
if isPlayer(target) then
creature:setTarget("Orc")
creature:setFollowCreature("Orc")
creature:searchTarget()
end

if isMonster(target) then
combat:execute(creature, var)
end

end
 
Skip all this scripting headache & edit monster.cpp
Change this
C++:
bool Monster::challengeCreature(Creature* creature)
{
    if (isSummon()) {
        return false;
    }

    bool result = selectTarget(creature);
    if (result) {
        targetChangeCooldown = 8000;
        targetChangeTicks = 0;
    }
    return result;
}
To this
C++:
bool Monster::challengeCreature(Creature* creature)
{
    /*
    if (isSummon()) {
        return false;
    }
    */

    bool result = selectTarget(creature);
    if (result) {
        targetChangeCooldown = 8000;
        targetChangeTicks = 0;
    }
    return result;
}
Now you should be able to use challenge as a spell for your summons. Aka "exeta res"
 
Skip all this scripting headache & edit monster.cpp
Change this
C++:
bool Monster::challengeCreature(Creature* creature)
{
    if (isSummon()) {
        return false;
    }

    bool result = selectTarget(creature);
    if (result) {
        targetChangeCooldown = 8000;
        targetChangeTicks = 0;
    }
    return result;
}
To this
C++:
bool Monster::challengeCreature(Creature* creature)
{
    /*
    if (isSummon()) {
        return false;
    }
    */

    bool result = selectTarget(creature);
    if (result) {
        targetChangeCooldown = 8000;
        targetChangeTicks = 0;
    }
    return result;
}
Now you should be able to use challenge as a spell for your summons. Aka "exeta res"


I mean normal monsters, not mine summon.
Like on respawn is Orc and Troll and they attack each other. Ignoring players.
 
There is way more to edit in the source to make that happen, not possible using Lua scripts. This would be very close to Friendly Monsters that I made. This is another thing that you are asking for and probably won't get for free.
 
Back
Top