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

Passive monster...

TibianusIII

New Member
Joined
Jan 22, 2010
Messages
6
Reaction score
0
Wazzup guyz, so like the title says... how can i do a monster that just attack if get attacked? i have to edit the source code? how i do it?
 
Not that easy to make. There are actions needed, not only monster file. I think i have asked for it a long time ago. Don't remember for now.
 
Something like this:
LUA:
function onAttack(cid, target)
    if isPlayer(cid) and isMonster(target) then
        doMonsterSetTarget(target, cid)
    elseif isMonster(cid) and isPlayer(target) then
        return false
    end
    return true
end
but I'm not sure.

Then to this monster.xml add lines:
XML:
<script>
    <event name="creatureEventName" />
</script>
 
And how i change in source? with what progams? i've never did this before..

To keep it short, I think your some years away from learning c++. Don't bother making this thing you're doing. Quit this project, start something new. Maybe download a rl map and run it for a month or so.. Don't go for something you're not able to make yourself, it's not like peopel around you are going to sit around doing all the work for you just because you come here and request it.
 
I actually think it's possible (yeh, I know it's outdated already, but perhaps someone will still need it in a future).

Code:
function onAttack(cid, target)
    if isPlayer(cid) and isMonster(target) then
[COLOR="#FF0000"][B]local name = getCreatureName(target)
local pos = getCreaturePosition(target)
doRemoveCreature(target)
doCreateMonster(pos ''..name..'1') -- You will of course need an another mosnter who just isn't flagged passive. Like Dragon (passive) and Dragon1 which is not passive. Name can stay the same, just the monsters.xml config name counts.[/B][/COLOR]
    elseif isMonster(cid) and isPlayer(target) then
        return false
    end
    return true
end
 
Back
Top