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

[REQUEST] C++ Code fix for change name

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Reaction score
4
i'm have setCreatureName system [Scarlet Ayleid]
http://otland.net/f35/change-existing-monster-name-game-131643/

i'm need a fix bug for send information to client with new name for monster.
how can I do to update the function name for people who are near the time of return? -- google translater..


PT:
to com o sistema de setCreatureName do Scarlet Ayleid..

eu gostaria de saber como posso fazer para atualizar o nome do monstro na hora da troca pa quem está perto dele nessa hora.
alguem pode ajudar?

vlw..

thanks.
bye =D
 
this, a minimal use of common sense is required

You could have asked on my thread, but fine

You'd have to remove the creature from the Spectators list, then change the name, and then re-send the creature to the spectators list

I didn't implemented that because IMO it wasn't needed because I just used this function when the monsters were summoned so you could easily summon the monster in a far away place, change its name, and then teleport it to the player, which is why its a setCreatureName, not a changeCreatureName :p

you can still work around it and make it work like you want without changing my function in the sources

Code:
function changeCreatureName(cid, newName, newDescription)
   local farAwayPos = {x = 100, y = 100, z = 7} --Just make a 3x3 square around these coordenates
    local pos = getCreaturePosition(cid)
    local mobName = getCreatureName(cid)
    local hp = getCreatureHealth(cid)
    local master = getCreatureMaster(cid)
    if master == cid then
        master = nil
    end
    doRemoveCreature(cid)
    cid = doCreateMonster(mobName, farAwayPos)
    setCreatureName(cid, newName, newDescription)
    doCreatureAddHealth(cid, -(getCreatureMaxHealth(cid) - hp))
    doTeleportThing(cid, pos)
    if master ~= nil then
        doConvinceCreature(master, cid)
    end
    return true
end

this will remove the creature, create a new one in the far away position, change the name and put its HP like it was and teleport it to its original place and if it has a master, it sets the master. The only thing it doesn't do is that it doesn't register any creature scripts to it, appart from that, it should work :)

 
Back
Top