Hello, first of all, I want to thank everybody who have supported me about this, on my earlier thread where I was allmost done with one script, and got lots of help. on both otland and ******.
I also wants to apologise for beeing so slow, since it was pretty much to do, (Tried 3 diffrent lua "skeletons" only one of them was bugfree) With this i mean i tried the first skeleton, did 4 scripts with 200 lines, then i tried the second skeleton with aprox 300 - 400 lines, then the third, this one, where i combinated Stix360's trade item for item npc, with bugfixed by Nahruto.
The bugfree complete scrips has more than 1000 lines total.
Main Info:
This thread contents 4 npc's [4 lua files, 4 xml files]
Theese npc's enchants weapons for you, each npc for each element [fire,ice,nature,energy]
If you scroll a bit down in this thread, I have also released the enchanted weapons! So this thread now includes both NPC's that enchants the weapons for you, and the weapons itself!
Recomendations:
* Tested and works on TFS 0.2.10, I can not guarantee it will work with other distros.
* Use level door + vocation door and locks the diffrent npcs in there [if you only want a special vocation to be able to enchant diffrent elements of weapons]
Getting started:
add this to data/npc
enchantfire.xml
Also add this to data/npc
enchantice.xml
Also add this to data/npc
enchantnature.xml
Also add this to data/npc
enchantenergy.xml
Now enter data/npc/scripts and add
firee.lua
Also add this to data/npc/scripts
icee.lua
Also add this to data/npc/scripts
naturee.lua
Also add this to data/npc/scripts
energye.lua
Here are some picture examples:
Detailed Information:
Credits goes to:
stix360 for giving me the example, witch gave me this idea.
Nahruto for beeing helpful, bugfixing, and made the script work propherly.
me (Luxitur, Znote[NOR]) For bothering fixing all diffrent ids and such things on a total of 12 scripts. [4 of them worked \o/ ]
Npc names:
Fire npc = Ruth Exuro = Ruthless Flames in latin
Ice npc = Glacies Tempestas = Ice Storm in latin
Nature npc = Torva Gero = Wild Bear in latin
Energy npc = Desumo Navitas = Electric Energy in latin
The 8.1 Enchanted Weapons!
The ultimade improovement all have been waiting for! <3<3<3 Nahruto!
This script contains all enchanted weapons in one NPC! Fire, earth, energy, ice all in one, only 200 lines! Much easier to configurate!
I also wants to apologise for beeing so slow, since it was pretty much to do, (Tried 3 diffrent lua "skeletons" only one of them was bugfree) With this i mean i tried the first skeleton, did 4 scripts with 200 lines, then i tried the second skeleton with aprox 300 - 400 lines, then the third, this one, where i combinated Stix360's trade item for item npc, with bugfixed by Nahruto.
The bugfree complete scrips has more than 1000 lines total.
Main Info:
This thread contents 4 npc's [4 lua files, 4 xml files]
Theese npc's enchants weapons for you, each npc for each element [fire,ice,nature,energy]
If you scroll a bit down in this thread, I have also released the enchanted weapons! So this thread now includes both NPC's that enchants the weapons for you, and the weapons itself!
Recomendations:
* Tested and works on TFS 0.2.10, I can not guarantee it will work with other distros.
* Use level door + vocation door and locks the diffrent npcs in there [if you only want a special vocation to be able to enchant diffrent elements of weapons]
Getting started:
add this to data/npc
enchantfire.xml
Code:
<?xml version="1.0"?>
<npc name="Ruth Exuro" script="data/npc/scripts/firee.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="143" head="94" body="114" legs="79" feet="79" addons="3" />
</npc>
Also add this to data/npc
enchantice.xml
Code:
<?xml version="1.0"?>
<npc name="Glacies Tempestas" script="data/npc/scripts/icee.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="251" head="0" body="85" legs="105" feet="85" addons="3" />
</npc>
Also add this to data/npc
enchantnature.xml
Code:
<?xml version="1.0"?>
<npc name="Torva Gero" script="data/npc/scripts/naturee.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="144" head="0" body="78" legs="75" feet="97" addons="3" />
</npc>
Also add this to data/npc
enchantenergy.xml
Code:
<?xml version="1.0"?>
<npc name="Desumo Navitas" script="data/npc/scripts/energye.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="57" body="79" legs="110" feet="91" addons="1" />
</npc>
Now enter data/npc/scripts and add
firee.lua
Code:
--- ------------------------------------------------------ ---
--- Inspired by stix360's npc trade item for item example. ---
--- ------------------------------------------------------ ---
--- -------------- Bugfixed by ----> Nahruto <---- ------- ---
--- ------------------------------------------------------ ---
--- -- The shit job was done by me, Luxitur, Znote[NOR] -- ---
--- ----------- The hoster of Znote & WooTserv ---------- ---
--- ------------------------------------------------------ ---
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, I can enchant some weapons with my fire enchant technique, just say enchant if youre intrested.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ill talk you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'enchant') then
selfSay('What weapon do you want to enchant to the fire version?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'spike sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2383) --- spike sword
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7744) --- Spike sword with fire enchant
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the spike sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'barbarian axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2429) --- barbarian axe
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the barbarian axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'relic sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7383) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7745) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the relic sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'blacksteel sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7406) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7747) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the blacksteel sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'dragon slayer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7402) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7748) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the dragon slayer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'mystic blade') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7384) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7746) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the mystic blade, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'knight axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2430) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7750) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the knight axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'heroic axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7389) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7751) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the heroic axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'headchopper') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7380) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7752) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the headchopper, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2454) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7753) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the war axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'clerical mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2423) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7754) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the clerical mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'crystal mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2445) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7755) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the crystal mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'cranial basher') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7415) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7756) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the cranial basher, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'orcish maul') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,7392) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7757) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the orcish maul, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war hammer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2391) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7758) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the war hammer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'arrow') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2795) --- 5 fire mushrooms
weap = getPlayerItemCount(cid,2544) --- weapon
if plats >= 60 and ing >= 5 and weap >= 100 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7840,100) --- fire enchanted weapon
else
selfSay('I need 60 platinum coins, 5 fire mushrooms and borrow the arrow, or else i cant enchant the weapon for you.')
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Goodbye!')
focus = 0
talk_start = 0
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Also add this to data/npc/scripts
icee.lua
Code:
--- ------------------------------------------------------ ---
--- Inspired by stix360's npc trade item for item example. ---
--- ------------------------------------------------------ ---
--- -------------- Bugfixed by ----> Nahruto <---- ------- ---
--- ------------------------------------------------------ ---
--- -- The shit job was done by me, Luxitur, Znote[NOR] -- ---
--- ----------- The hoster of Znote & WooTserv ---------- ---
--- ------------------------------------------------------ ---
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, I can enchant some weapons with my ice enchant technique, just say enchant if youre intrested.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ill talk you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'enchant') then
selfSay('What weapon do you want to enchant to the ice version?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'spike sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2383) --- spike sword
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7763) --- Spike sword with ice enchant
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the spike sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'barbarian axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2429) --- barbarian axe
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7768) --- barbarian axe with ice enchant
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the barbarian axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'relic sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7383) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7764) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the relic sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'blacksteel sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7406) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7766) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the blacksteel sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'dragon slayer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7402) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7767) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the dragon slayer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'mystic blade') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7384) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7765) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the mystic blade, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'knight axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2430) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7769) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the knight axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'heroic axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7389) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7770) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the heroic axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'headchopper') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7380) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7771) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the headchopper, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2454) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7772) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the war axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'clerical mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2423) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7773) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the clerical mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'crystal mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2445) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7774) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the crystal mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'cranial basher') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7415) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7775) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the cranial basher, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'orcish maul') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,7392) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7776) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the orcish maul, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war hammer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2391) --- weapon
if plats >= 60 and ing >= 5 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7777) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the war hammer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'arrow') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,7290) --- 5 ice shards
weap = getPlayerItemCount(cid,2544) --- weapon
if plats >= 60 and ing >= 5 and weap >= 100 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,7290,5) --- 5 ice shards
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7839,100) --- ice enchanted weapon
else
selfSay('I need 60 platinum coins, 5 ice shards and borrow the arrow, or else i cant enchant the weapon for you.')
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Goodbye!')
focus = 0
talk_start = 0
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Also add this to data/npc/scripts
naturee.lua
Code:
--- ------------------------------------------------------ ---
--- Inspired by stix360's npc trade item for item example. ---
--- ------------------------------------------------------ ---
--- -------------- Bugfixed by ----> Nahruto <---- ------- ---
--- ------------------------------------------------------ ---
--- -- The shit job was done by me, Luxitur, Znote[NOR] -- ---
--- ----------- The hoster of Znote & WooTserv ---------- ---
--- ------------------------------------------------------ ---
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, I can enchant some weapons with my nature enchant technique, just say enchant if youre intrested.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ill talk you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'enchant') then
selfSay('What weapon do you want to enchant to the nature version?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'spike sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2383) --- spike sword
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7854) --- Spike sword with nature enchant
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the spike sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'barbarian axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2429) --- barbarian axe
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7859) --- barbarian axe with nature enchant
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the barbarian axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'relic sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7383) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7855) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the relic sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'blacksteel sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7406) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7857) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the blacksteel sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'dragon slayer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7402) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7858) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the dragon slayer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'mystic blade') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7384) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7856) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the mystic blade, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'knight axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2430) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7860) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the knight axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'heroic axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7389) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7861) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the heroic axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'headchopper') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7380) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7862) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the headchopper, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2454) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7863) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the war axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'clerical mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2423) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7864) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the clerical mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'crystal mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2445) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7865) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the crystal mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'cranial basher') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7415) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7866) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the cranial basher, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'orcish maul') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,7392) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7867) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the orcish maul, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war hammer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2391) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7868) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the war hammer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'arrow') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,4850) --- 1 hydra egg
weap = getPlayerItemCount(cid,2544) --- weapon
if plats >= 60 and ing >= 5 and weap >= 100 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,4850,1) --- 1 hydra egg
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7850,100) --- nature enchanted weapon
else
selfSay('I need 60 platinum coins, a hydra egg and borrow the arrow, or else i cant enchant the weapon for you.')
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Goodbye!')
focus = 0
talk_start = 0
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Also add this to data/npc/scripts
energye.lua
Code:
--- ------------------------------------------------------ ---
--- Inspired by stix360's npc trade item for item example. ---
--- ------------------------------------------------------ ---
--- -------------- Bugfixed by ----> Nahruto <---- ------- ---
--- ------------------------------------------------------ ---
--- -- The shit job was done by me, Luxitur, Znote[NOR] -- ---
--- ----------- The hoster of Znote & WooTserv ---------- ---
--- ------------------------------------------------------ ---
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, I can enchant some weapons with my energy enchant technique, just say enchant if youre intrested.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ill talk you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'enchant') then
selfSay('What weapon do you want to enchant to the energy version?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'spike sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2383) --- spike sword
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7869) --- Spike sword with energy enchant
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the spike sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'barbarian axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2429) --- barbarian axe
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7874) --- barbarian axe with energy enchant
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the barbarian axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'relic sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7383) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7870) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the relic sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'blacksteel sword') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7406) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7872) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the blacksteel sword, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'dragon slayer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7402) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7873) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the dragon slayer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'mystic blade') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7384) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7871) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the mystic blade, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'knight axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2430) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7875) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the knight axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'heroic axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7389) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7876) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the heroic axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'headchopper') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7380) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7877) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the headchopper, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war axe') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2454) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7878) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the war axe, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'clerical mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2423) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7879) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the clerical mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'crystal mace') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2445) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7880) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the crystal mace, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'cranial basher') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7415) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7881) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the cranial basher, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'orcish maul') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,7392) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7882) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the orcish maul, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'war hammer') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2391) --- weapon
if plats >= 60 and ing >= 1 and weap >= 1 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7883) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the war hammer, or else i cant enchant the weapon for you.')
end
elseif talk_state == 1 then
if msgcontains(msg, 'arrow') then
plats = getPlayerItemCount(cid,2152) --- 60 platinum coins
ing = getPlayerItemCount(cid,2124) --- 1 crystal ring
weap = getPlayerItemCount(cid,2544) --- weapon
if plats >= 60 and ing >= 1 and weap >= 100 then
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2124,1) --- 1 crystal ring
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid,7838,100) --- energy enchanted weapon
else
selfSay('I need 60 platinum coins, a crystal ring and borrow the arrow, or else i cant enchant the weapon for you.')
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Goodbye!')
focus = 0
talk_start = 0
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Here are some picture examples:
Detailed Information:
Credits goes to:
stix360 for giving me the example, witch gave me this idea.
Nahruto for beeing helpful, bugfixing, and made the script work propherly.
me (Luxitur, Znote[NOR]) For bothering fixing all diffrent ids and such things on a total of 12 scripts. [4 of them worked \o/ ]
Npc names:
Fire npc = Ruth Exuro = Ruthless Flames in latin
Ice npc = Glacies Tempestas = Ice Storm in latin
Nature npc = Torva Gero = Wild Bear in latin
Energy npc = Desumo Navitas = Electric Energy in latin
The 8.1 Enchanted Weapons!
oki, I will release it then:
Add this to items.xml
data/items/items.xml
Code:<item id="7744" name="spike sword"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="31"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7745" name="relic sword"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7746" name="mystic blade"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7384"/> <attribute key="extradef" value="2"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7747" name="blacksteel sword"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="27"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7406"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7748" name="dragon slayer"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="51"/> <attribute key="defense" value="34"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7402"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7749" name="barbarian axe"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2429"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7750" name="knight axe"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="40"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2430"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7751" name="heroic axe"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="24"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7389"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7752" name="headchopper"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7380"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7753" name="war axe"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="58"/> <attribute key="defense" value="10"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2454"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7754" name="clerical mace"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="15"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2423"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7755" name="crystal mace"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="45"/> <attribute key="defense" value="21"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2445"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7756" name="cranial basher"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="20"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7415"/> <attribute key="extradef" value="-2"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7757" name="orcish maul"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="44"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7392"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7758" name="war hammer"> <attribute key="description" value="It is temporarily enchanted with fire."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="52"/> <attribute key="defense" value="15"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2391"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7759" article="a" name="small enchanted sapphire" plural="small enchanted sapphires"> <attribute key="weight" value="10"/> </item> <item id="7760" article="a" name="small enchanted ruby" plural="small enchanted rubies"> <attribute key="weight" value="10"/> </item> <item id="7761" article="a" name="small enchanted emerald" plural="small enchanted emeralds"> <attribute key="weight" value="10"/> </item> <item id="7762" article="a" name="small enchanted amethyst" plural="small enchanted amethysts"> <attribute key="weight" value="10"/> </item> <item id="7763" name="spike sword"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="31"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7764" name="relic sword"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7765" name="mystic blade"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="44"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7384"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7766" name="blacksteel sword"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="27"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7406"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7767" name="dragon slayer"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="54"/> <attribute key="defense" value="34"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7402"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7768" name="barbarian axe"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2429"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7769" name="knight axe"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="40"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2430"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7770" name="heroic axe"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="24"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7389"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7771" name="headchopper"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7380"/> <attribute key="showduration" value="1"/> <attribute key="slotType" value="two-handed"/> <attribute key="showcharges" value="1"/> </item> <item id="7772" name="war axe"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="58"/> <attribute key="defense" value="10"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2454"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7773" name="clerical mace"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="21"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2423"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7774" name="crystal mace"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="45"/> <attribute key="defense" value="21"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2445"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7775" name="cranial basher"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="20"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7415"/> <attribute key="extradef" value="-2"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7776" name="orcish maul"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="44"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7392"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7777" name="war hammer"> <attribute key="description" value="It is temporarily enchanted with ice."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="52"/> <attribute key="defense" value="15"/> <attribute key="weaponType" value="club"/> <attribute key="decayTo" value="2391"/> <attribute key="charges" value="1000"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7838" article="an" name="flash arrow" plural="flash arrows"> <attribute key="weight" value="70"/> <attribute key="weaponType" value="ammunition"/> <attribute key="ammoType" value="arrow"/> <attribute key="shootType" value="flasharrow"/> <attribute key="ammoAction" value="removecount"/> </item> <item id="7839" article="an" name="shiver arrow" plural="shiver arrows"> <attribute key="weight" value="70"/> <attribute key="weaponType" value="ammunition"/> <attribute key="ammoType" value="arrow"/> <attribute key="shootType" value="shiverarrow"/> <attribute key="ammoAction" value="removecount"/> </item> <item id="7840" article="an" name="flaming arrow" plural="flaming arrows"> <attribute key="weight" value="70"/> <attribute key="weaponType" value="ammunition"/> <attribute key="ammoType" value="arrow"/> <attribute key="shootType" value="flammingarrow"/> <attribute key="ammoAction" value="removecount"/> </item> <item id="7850" article="an" name="earth arrow" plural="earth arrow"> <attribute key="weight" value="70"/> <attribute key="weaponType" value="ammunition"/> <attribute key="ammoType" value="arrow"/> <attribute key="shootType" value="eartharrow"/> <attribute key="ammoAction" value="removecount"/> </item> <item id="7854" name="spike sword"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="31"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7855" name="relic sword"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7856" name="mystic blade"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7384"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7857" name="blacksteel sword"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="27"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7406"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7858" name="dragon slayer"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="53"/> <attribute key="defense" value="34"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7402"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7859" name="barbarian axe"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2429"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7860" name="knight axe"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="42"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2430"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7861" name="heroic axe"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="24"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7389"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7862" name="headchopper"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7380"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7863" name="war axe"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="58"/> <attribute key="defense" value="10"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2454"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7864" name="clerical mace"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2423"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7865" name="crystal mace"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="45"/> <attribute key="defense" value="21"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2445"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7866" name="cranial basher"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="20"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7415"/> <attribute key="slotType" value="two-handed"/> <attribute key="extradef" value="-2"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7867" name="orcish maul"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="44"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7392"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7868" name="war hammer"> <attribute key="description" value="It is temporarily enchanted with earth."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="52"/> <attribute key="defense" value="15"/> <attribute key="weaponType" value="club"/> <attribute key="decayTo" value="2391"/> <attribute key="charges" value="1000"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7869" name="spike sword"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="31"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7870" name="relic sword"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7383"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7871" name="mystic blade"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="28"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7384"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7872" name="blacksteel sword"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="27"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7406"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7873" name="dragon slayer"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="51"/> <attribute key="defense" value="34"/> <attribute key="weaponType" value="sword"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7402"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7874" name="barbarian axe"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="38"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2429"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7875" name="knight axe"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="40"/> <attribute key="defense" value="26"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2430"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7876" name="heroic axe"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="46"/> <attribute key="defense" value="24"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7389"/> <attribute key="extradef" value="1"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7877" name="headchopper"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="49"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7380"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7878" name="war axe"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="58"/> <attribute key="defense" value="10"/> <attribute key="weaponType" value="axe"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2454"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7879" name="clerical mace"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="40"/> <attribute key="defense" value="25"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2423"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7880" name="crystal mace"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="35"/> <attribute key="defense" value="21"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2445"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7881" name="cranial basher"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="36"/> <attribute key="defense" value="20"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7415"/> <attribute key="slotType" value="two-handed"/> <attribute key="extradef" value="-2"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7882" name="orcish maul"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="34"/> <attribute key="defense" value="18"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="7392"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item> <item id="7883" name="war hammer"> <attribute key="description" value="It is temporarily enchanted with energy."/> <attribute key="weight" value="5000"/> <attribute key="attack" value="42"/> <attribute key="defense" value="15"/> <attribute key="weaponType" value="club"/> <attribute key="charges" value="1000"/> <attribute key="decayTo" value="2391"/> <attribute key="slotType" value="two-handed"/> <attribute key="showduration" value="1"/> <attribute key="showcharges" value="1"/> </item>
Add this to weapons.xml
data/weapons/weapons.xml
Code:<!-- enchanted weapons --> <melee id="7744" script="fire.lua"/> --spike sword <melee id="7763" script="ice.lua"/> <melee id="7854" script="earth.lua"/> <melee id="7869" script="energy.lua"/> <melee id="7747" level="35" unproperly="1" script="fire.lua"> //blacksteel sword <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7766" level="35" unproperly="1" script="ice.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7857" level="35" unproperly="1" script="earth.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7872" level="35" unproperly="1" script="energy.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7748" level="45" unproperly="1" script="fire.lua"> --dragon slayer <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7767" level="45" unproperly="1" script="ice.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7858" level="45" unproperly="1" script="earth.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7873" level="45" unproperly="1" script="energy.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7745" level="50" unproperly="1" script="fire.lua"/> --relic sword <melee id="7764" level="50" unproperly="1" script="ice.lua"/> <melee id="7855" level="50" unproperly="1" script="earth.lua"/> <melee id="7870" level="50" unproperly="1" script="energy.lua"/> <melee id="7746" level="60" unproperly="1" script="fire.lua"/> --mystic blade <melee id="7765" level="60" unproperly="1" script="ice.lua"/> <melee id="7856" level="60" unproperly="1" script="earth.lua"/> <melee id="7871" level="60" unproperly="1" script="energy.lua"/> <melee id="7754" level="20" unproperly="1" script="fire.lua"/> --clerical mace <melee id="7773" level="20" unproperly="1" script="ice.lua"/> <melee id="7864" level="20" unproperly="1" script="earth.lua"/> <melee id="7879" level="20" unproperly="1" script="energy.lua"/> <melee id="7755" level="35" unproperly="1" script="fire.lua"/> --crystal mace <melee id="7774" level="35" unproperly="1" script="ice.lua"/> <melee id="7865" level="35" unproperly="1" script="earth.lua"/> <melee id="7880" level="35" unproperly="1" script="energy.lua"/> <melee id="7757" level="35" unproperly="1" script="fire.lua"/> --orcish maul <melee id="7776" level="35" unproperly="1" script="ice.lua"/> <melee id="7867" level="35" unproperly="1" script="earth.lua"/> <melee id="7882" level="35" unproperly="1" script="energy.lua"/> <melee id="7758" level="50" unproperly="1" script="fire.lua"/> --war hammer <melee id="7777" level="50" unproperly="1" script="ice.lua"/> <melee id="7868" level="50" unproperly="1" script="earth.lua"/> <melee id="7883" level="50" unproperly="1" script="energy.lua"/> <melee id="7756" level="60" unproperly="1" script="fire.lua"/> --cranial basher <melee id="7775" level="60" unproperly="1" script="ice.lua"/> <melee id="7866" level="60" unproperly="1" script="earth.lua"/> <melee id="7881" level="60" unproperly="1" script="energy.lua"/> <melee id="7749" level="20" unproperly="1" script="fire.lua"/> --barbarian axe <melee id="7768" level="20" unproperly="1" script="ice.lua"/> <melee id="7859" level="20" unproperly="1" script="earth.lua"/> <melee id="7874" level="20" unproperly="1" script="energy.lua"/> <melee id="7750" level="25" unproperly="1" script="fire.lua"/> --knight axe <melee id="7769" level="25" unproperly="1" script="ice.lua"/> <melee id="7860" level="25" unproperly="1" script="earth.lua"/> <melee id="7875" level="25" unproperly="1" script="energy.lua"/> <melee id="7752" level="35" unproperly="1" script="fire.lua"> --headchopper <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7771" level="35" unproperly="1" script="ice.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7862" level="35" unproperly="1" script="earth.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7877" level="35" unproperly="1" script="energy.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7751" level="60" unproperly="1" script="fire.lua"/> --heroic axe <melee id="7770" level="60" unproperly="1" script="ice.lua"/> <melee id="7861" level="60" unproperly="1" script="earth.lua"/> <melee id="7876" level="60" unproperly="1" script="energy.lua"/> <melee id="7753" level="65" unproperly="1" script="fire.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7772" level="65" unproperly="1" script="ice.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7863" level="65" unproperly="1" script="earth.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <melee id="7878" level="65" unproperly="1" script="energy.lua"> <vocation name="Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </melee> <distance id="7838" level="20" unproperly="1" script="flash_arrow.lua"/> <distance id="7839" level="20" unproperly="1" script="shiver_arrow.lua"/> <distance id="7840" level="20" unproperly="1" script="flaming_arrow.lua"/> <distance id="7850" level="20" unproperly="1" script="earth_arrow.lua"/>
enter data/weapons/scripts and create:
earth.lua
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STONES) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local min = 0 local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
energy.lua
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local min = 0 local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
fire.lua
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local min = 0 local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
ice.lua
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local min = 0 local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
The credits goes to:
Starmio (items scripts)
AGS (weapon scripts)
Znote (modifyed to improove a little)
The ultimade improovement all have been waiting for! <3<3<3 Nahruto!
PHP:
local FireEnch = {vocs={1, 5}, lvl=30, ing1=2152, count1=60, ing2=2795, count2=5}
local EnergyEnch = {vocs={1, 5}, lvl=30, ing1=2152, count1=60, ing2=2124, count2=1}
local IceEnch = {vocs={2, 6}, lvl=30, ing1=2152, count1=60, ing2=7290, count2=5}
local EarthEnch = {vocs={2, 6}, lvl=30, ing1=2152, count1=60, ing2=4850, count2=1}
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
local Weapons = {
["spike sword"]={n=2383, F=7744, E=7869, I=7763, N=7854},
["barbarian axe"]={n=2429, F=7749, E=7874, I=7768, N=7859},
["relic sword"]={n=7383, F=7745, E=7870, I=7764, N=7855},
["blacksteel sword"]={n=7406, F=7747, E=7872, I=7766, N=7857},
["dragon slayer"]={n=7402, F=7748, E=7873, I=7767, N=7858},
["mystic blade"]={n=7384, F=7746, E=7871, I=7765, N=7856},
["knight axe"]={n=2430, F=7750, E=7875, I=7769, N=7860},
["heroic axe"]={n=7389, F=7751, E=7876, I=7770, N=7861},
["headchopper"]={n=7380, F=7752, E=7877, I=7771, N=7862},
["war axe"]={n=2454, F=7753, E=7878, I=7772, N=7863},
["clerical mace"]={n=2423, F=7754, E=7879, I=7773, N=7864},
["crystal mace"]={n=2445, F=7755, E=7880, I=7774, N=7865},
["cranial basher"]={n=7415, F=7756, E=7881, I=7775, N=7866},
["orcish maul"]={n=7392, F=7757, E=7882, I=7776, N=7867},
["war hammer"]={n=2391, F=7758, E=7883, I=7777, N=7868}
}
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello, I am an enchanter, what do you seek?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ill talk you in a minute.')
elseif focus == cid then
talk_start = os.clock()
local pVoc = getPlayerVocation(cid)
local pLvl = getPlayerLevel(cid)
if msgcontains(msg, 'enchant') then
selfSay('What element you want to enchant ?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'fire') then
if isInArray(FireEnch.vocs, pVoc) == TRUE then
if pLvl >= FireEnch.lvl then
selfSay('What weapon do you want to enchant to the fire version?')
talk_state = 2
else
selfSay('sorry, you don\'t have the enough level.')
end
else
selfSay('sorry, you don\'t have the required vocation.')
end
elseif msgcontains(msg, 'energy') then
if isInArray(EnergyEnch.vocs, pVoc) == TRUE then
if pLvl >= EnergyEnch.lvl then
selfSay('What weapon do you want to enchant to the energy version?')
talk_state = 3
else
selfSay('sorry, you don\'t have the enough level.')
end
else
selfSay('sorry, you don\'t have the required vocation.')
end
elseif msgcontains(msg, 'ice') then
if isInArray(IceEnch.vocs, pVoc) == TRUE then
if pLvl >= IceEnch.lvl then
selfSay('What weapon do you want to enchant to the ice version?')
talk_state = 4
else
selfSay('sorry, you don\'t have the enough level.')
end
else
selfSay('sorry, you don\'t have the required vocation.')
end
elseif msgcontains(msg, 'nature') or msgcontains(msg, 'earth') then
if isInArray(EarthEnch.vocs, pVoc) == TRUE then
if pLvl >= EarthEnch.lvl then
selfSay('What weapon do you want to enchant to the nature version?')
talk_state = 5
else
selfSay('sorry, you don\'t have the enough level.')
end
else
selfSay('sorry, you don\'t have the required vocation.')
end
end
elseif talk_state == 2 then
local Ench = Weapons[msg]
if Ench then
if getPlayerItemCount(cid, FireEnch.ing1) >= FireEnch.count1 and getPlayerItemCount(cid, FireEnch.ing2) >= FireEnch.count2 then
if getPlayerItemCount(cid, Ench.n) >= 1 then
doPlayerRemoveItem(cid, FireEnch.ing1, FireEnch.count1)
doPlayerRemoveItem(cid, FireEnch.ing2, FireEnch.count2)
doPlayerRemoveItem(cid, Ench.n, 1)
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid, Ench.F, 1)
else
selfSay("I need ".. FireEnch.count1 .." ".. getItemName(FireEnch.ing1) ..", ".. FireEnch.count2 .." ".. getItemName(FireEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay("I need ".. FireEnch.count1 .." ".. getItemName(FireEnch.ing1) ..", ".. FireEnch.count2 .." ".. getItemName(FireEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay('This weapon is not in the list.')
end
elseif talk_state == 3 then
local Ench = Weapons[msg]
if Ench then
if getPlayerItemCount(cid, EnergyEnch.ing1) >= EnergyEnch.count1 and getPlayerItemCount(cid, EnergyEnch.ing2) >= EnergyEnch.count2 then
if getPlayerItemCount(cid, Ench.n) >= 1 then
doPlayerRemoveItem(cid, EnergyEnch.ing1, EnergyEnch.count1)
doPlayerRemoveItem(cid, EnergyEnch.ing2, EnergyEnch.count2)
doPlayerRemoveItem(cid, Ench.n, 1)
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid, Ench.E, 1)
else
selfSay("I need ".. EnergyEnch.count1 .." ".. getItemName(EnergyEnch.ing1) ..", ".. EnergyEnch.count2 .." ".. getItemName(EnergyEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay("I need ".. EnergyEnch.count1 .." ".. getItemName(EnergyEnch.ing1) ..", ".. EnergyEnch.count2 .." ".. getItemName(EnergyEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay('This weapon is not in the list.')
end
elseif talk_state == 4 then
local Ench = Weapons[msg]
if Ench then
if getPlayerItemCount(cid, IceEnch.ing1) >= IceEnch.count1 and getPlayerItemCount(cid, IceEnch.ing2) >= IceEnch.count2 then
if getPlayerItemCount(cid, Ench.n) >= 1 then
doPlayerRemoveItem(cid, IceEnch.ing1, IceEnch.count1)
doPlayerRemoveItem(cid, IceEnch.ing2, IceEnch.count2)
doPlayerRemoveItem(cid, Ench.n, 1)
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid, Ench.I, 1)
else
selfSay("I need ".. IceEnch.count1 .." ".. getItemName(IceEnch.ing1) ..", ".. IceEnch.count2 .." ".. getItemName(IceEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay("I need ".. IceEnch.count1 .." ".. getItemName(IceEnch.ing1) ..", ".. IceEnch.count2 .." ".. getItemName(IceEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay('This weapon is not in the list.')
end
elseif talk_state == 5 then
local Ench = Weapons[msg]
if Ench then
if getPlayerItemCount(cid, EarthEnch.ing1) >= EarthEnch.count1 and getPlayerItemCount(cid, EarthEnch.ing2) >= EarthEnch.count2 then
if getPlayerItemCount(cid, Ench.n) >= 1 then
doPlayerRemoveItem(cid, EarthEnch.ing1, EarthEnch.count1)
doPlayerRemoveItem(cid, EarthEnch.ing2, EarthEnch.count2)
doPlayerRemoveItem(cid, Ench.n, 1)
selfSay('Enchantmenth completed, here is your weapon.')
doPlayerAddItem(cid, Ench.N, 1)
else
selfSay("I need ".. EarthEnch.count1 .." ".. getItemName(EarthEnch.ing1) ..", ".. EarthEnch.count2 .." ".. getItemName(EarthEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay("I need ".. EarthEnch.count1 .." ".. getItemName(EarthEnch.ing1) ..", ".. EarthEnch.count2 .." ".. getItemName(EarthEnch.ing2) .." and borrow the weapon, or else i cant enchant the weapon for you.")
end
else
selfSay('This weapon is not in the list.')
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Goodbye!')
focus = 0
talk_start = 0
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
This script contains all enchanted weapons in one NPC! Fire, earth, energy, ice all in one, only 200 lines! Much easier to configurate!
Ahh, ye, well its working, its just that the arrows arent working, the other weapons are working!
data/weapons/scripts
flash_arrow.lua
PHP:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FLASHARROW) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local attack = 25 local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE) local min = 0 local max = -(attack/20*skill+attack+skill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
flaming_arrow.lua
PHP:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FLAMMINGARROW) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local attack = 25 local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE) local min = 0 local max = -(attack/20*skill+attack+skill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
shiver_arrow.lua
PHP:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SHIVERARROW) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local attack = 25 local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE) local min = 0 local max = -(attack/20*skill+attack+skill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
earth_arrow.lua
PHP:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STONES) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTHARROW) --setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0) function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength) local level = getPlayerLevel(cid) local attack = 25 local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE) local min = 0 local max = -(attack/20*skill+attack+skill+level/10)/10*10 return min, max end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
Last edited: