• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[LUA] Vocation Scroll doesnt work to 100%

Cute Fighter

The Restart
Joined
Jan 3, 2009
Messages
72
Reaction score
0
Location
Germany
heey
i made a scroll, which should give a certain vocation...
i wanted to make a marriage system but i cant because i'M usig sqlite...so i make an alternative to it...i wanted to make new vocations so they will have a "marriage status"...
Example:
Christina got married with Chaoz..i made a vocation named : Sorcerer Wife of Chaoz
.xml:
<vocation id="14" name="Sorcerer Wife of Chaoz" description="a Sorcerer Wife of Chaoz" needpremium="1" gaincap="10" gainhp="5" gainmana="35" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="5">

<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>

...to get this status i made a scroll for them and thats the scroll:

function onUse(cid, item, frompos, item2, topos)

if item.itemid == 7534 then
if getPlayerItemCount(cid,2159) >= 2 then
doSendAnimatedText(getPlayerPosition(cid), "Ahhh, Married!", TEXTCOLOR_RED)
doCreatureSay(cid, "Gratulations!. ", TALKTYPE_ORANGE_1)
doPlayerSetVocation(cid, 14)
doRemoveItem(cid,item.uid, 1)
doPlayerRemoveItem(cid,2159, 2)
else
doPlayerSendCancel(cid,'You havent enough Donation Coins')
doRemoveItem(cid,item.uid, 1)
end
else
end
return 1
end

7534=scroll
2157=scarab coin

it works fine, she gets the status or "vocation" but after she relogged it disappears :/

what i forgot or what is wrong? pls help :/
rep++
 
Lua:
function onUse(cid, item, frompos, item2, topos)
     if doPlayerRemoveItem(cid,2159, 2) == TRUE then
         doPlayerSetVocation(cid, 14)
         doRemoveItem(cid,item.uid, 1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
     else
         doPlayerSendCancel(cid, "You havent enough Donation Coins")
     end 
   return TRUE
end

OR

for this:
you just have to config vocations.xml

Lua:
function onUse(cid, item, frompos, item2, topos)
     if doPlayerRemoveItem(cid,2159, 2) == TRUE then
	 setPlayerPromotionLevel(cid, 2)
         doRemoveItem(cid,item.uid, 1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
     else
         doPlayerSendCancel(cid, "You havent enough Donation Coins")
     end 
   return TRUE
end
 
Back
Top