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

Weapon Leveling System (With Unique Experience Tables)

Eiffel

EternumOT Mapper/Designer
Joined
Nov 17, 2008
Messages
279
Reaction score
140
Location
Bakersfield, CA
Hello. I've been having trouble trying to make this script/system for my upcoming server.

I need a script that transfers the experience to your weapon whenever you kill a monster. Players still receive experience, but it also goes to the weapon. There are 4 tiers of weapons: Normal, Rare, Epic, Legendary
I won't be using a randomize system for the stats of weapons, so all tiers of weapons will be handpicked by me and be given stats by me, as well as the bonuses they get whenever they level up past certain levels.


Example

I loot a Normal weapon. It happens to be a Spike Sword. I kill a boss and loot a Legendary sword. It happens to be a Haunted Blade.

The Spike Sword I have used for some time, so it leveled up 10 times. It reads as "lvl 10 Spike Sword" and has 10 more damage than a normal Spike Sword at level 1. Since it's a normal weapon, it levels the fastest (has smallest experience table).

The Haunted Blade I looted has 50 ATK and 100 DEF. I start using it but it takes me forever to get to level 2. Once I hit level 2, I goes to 150 ATK and 200 DEF. I really like this weapon, so I decide to keep using it. I get it to level 5, making it a 450 ATK and 500 DEF, as well as unlocking an ability for the weapon. For sake of example, the ability is that whenever you attack, you get 10% lifesteal.




Also, if possible, I'd like to be able to apply this system to Helmet, Chest, And Leg Pieces.
 
doSetItemAttribute(item, "experience", ##)
getItemAttribute(item, "experience")

(You can give an item any attribute you want)
Then just go to a "onStatsChange" creaturescript and make it add it to your weapon too. You will have to make the experience tables yourself.
If you have any questions let me know.
 
My friend Flatlander, I think Eiffel is looking for the script to be Made, not how to make it. look under his name he is a
Mapper/Designer, Not a scripter, not everyone knows how to script, sometimes explaining the answer does not help at all.

I support Eiffel's idea, if anyone is willing to make the script Eiffel has described we would be very grateful.
 
My friend Flatlander, I think Eiffel is looking for the script to be Made, not how to make it. look under his name he is a
Mapper/Designer, Not a scripter, not everyone knows how to script, sometimes explaining the answer does not help at all.

I support Eiffel's idea, if anyone is willing to make the script Eiffel has described we would be very grateful.
indeed we wold!

also bump
 
I don't like just MAKING scripts because then no one will learn how to fix things themselves.

Instead I've been working on making a better version of TFS so you can script even more amazing things more easily.

Here is all I will give you (this will just give your weapon experience, it won't level up or anything, but its a HUGE start)
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
   local amount = newLevel - oldLevel
   if skill == 9 then
     local item = getPlayerWeapon(cid)
     if item then
       local wexp = getItemAttribute(item.uid, "experience")
       if wexp == nil then
         wexp = 0
       end
       wexp = wexp + amount
       doItemSetAttribute(item.uid, "experience", wexp)
     end
   end
   return true
end

And here is a onLook script that should let you see what experience a weapon has (It is really basic, you can update what you want to see yourself)

Code:
function onLook(cid, thing, position, lookDistance)
   if isCreature(thing) then
     return true
   end
   local info = getItemInfo(thing.itemid)
   if info.weaponType > 0 and info.weaponType ~= 8 then
     local wexp = getItemAttribute(thing.uid, "experience")
     local level = getItemAttribute(thing.uid, "level")
     local name = getItemName(thing.uid)
     if wexp == nil then
       wexp = 0
       doItemSetAttribute(thing.uid, "experience", wexp)
     end
     if level == nil then
       level = 0
       doItemSetAttribute(thing.uid, "level", level)
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see "..info.article.." "..name..". (atk:"..info.attack.."+"..info.extraAttack.." def:"..info.defense.."+"..info.extraDefense..")\nItem Experience ["..wexp.."] Item Level ["..level.."]")
     return false
   end
   return true
end
 
Last edited:
Back
Top