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

Script to set player stats like the sample used to create new characters - WAR server 12.0

igorlagoas

New Member
Joined
Feb 3, 2018
Messages
4
Reaction score
0
Hello,
First, sorry if i write anything wrong, that's not my first language.

I'm creating a server which is 100% war. So, to do that, i was trying to make a script to set level, skill, itens, everything of a player when he die to the level, skill, itens, etc, of the sample used to create new characters.

There's a query on phpmyadmin that can do this? Have another way to do? I just want to "reset" to same stats of the sample characterer when someones die. That's it. If someone could help me, i'll be so thankful.

I'm not sure the version of TFS i'm using, but i think that's 1.2 or 1.3. The server is: opentibiabr/otservbr-global (https://github.com/opentibiabr/OTServBR-Global)

Hugs.
 
Last edited:
You need to change in database, in players table, save default value from 1 to 0.
 
Hello, @margoh

I did this to free acc players who will login with acc 1/1, but o wanted to premium players only "reset" exp, itens, etc, when they die, not with logout.
There's a way to load some infos of vocation sample? Like, if i could load itens and exp from the sample of the vocation player when he die, It would solve my problem
 
@yosoyjuanx You can try something like this
Code:
function onDeath(cid)
    addEvent(db.executeQuery, 1, "UPDATE `players` SET `maglevel` = 0 WHERE `id` = " .. getPlayerGUID(cid)) -- magic
    addEvent(db.executeQuery, 1, "UPDATE `player_skills` SET `0` = 10, `1` = 10, `2` = 10, `3` = 10, `4` = 10, `5` = 10, `6` = 10 WHERE `id` = " .. getPlayerGUID(cid)) -- skills
    return true
end
Code:
<event type="death" name="DeathReset" script="deathreset.lua" />
Regards!
 
Back
Top