PS

(Help) Promotion Usando Item

Por psybreak, 28 de jul. de 2010 em Archived

script
27
2.2k
psybreakP
28 de julho de 2010 às 19:40

eu preciso de 1 script quando vc clica no item vc muda de vocaçao eu tenho o script

mais ele so muda uma vocaçao

ex:tenho 3 promotions no meu server

EK.. FREE

REVO KNIGHT.. VIP

EXTREME KNIGHT..SUPER VIP

 

AE QUERIA SE QUANDO O PLAYER QUAL QUER VOCAÇAO USA-SE MUDAVA DE VOCAÇAO SEM POBLEMAS

 

ex: de um poblema

o revo knight quando eu digo epic

se eu for elite knight fala que eu ja so promoted

 

eu quero que nao bugemm

 

tipow quero 2 uma de vira revo e outra pra extreme

 

alguem me ajuda

ae o script \/ colokei pra usa no item 2348

local t = { --- config

tovoc = 4 --- what vocation the user will get

}

 

function onUse(cid,item,fromPosition,toPosition,itemEx)

local v = getThingPos(cid)

if getPlayerVocation(cid) ~= 4 then

doPlayerSetVocation(cid,t.tovoc)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

return true

end

 

 

ids da novas vocaçao

revolutions: 9.10.11.12

Extremes:13,14,15,16

 

 

alguem me ajuda pow tem 2 dias que eu nao durmo tentano arruma isso

ajuda ae galera porfavor quero durmi nao to aguentano mais so com cafe

Editado Julho 28 por psybreak

VodkartV
28 de julho de 2010 às 20:14

function onUse(cid,item,fromPosition,toPosition,itemEx)

local v = getThingPos(cid)

 

if isInArray({9}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,13)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({10}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,14)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({11}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,15)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({12}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,16)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

return TRUE

end

psybreakP
28 de julho de 2010 às 20:19

tipow pra revo para extreme ta dano certo

mais as voc normal pra subi para as outras nao da certo :D

oia oqe fala

20:18 You are already Druid!

20:18 You are already Druid!

20:18 You are already Druid!

20:18 You are already Druid!

 

tentei ele com druid nao de certo

dps virei elder tbm nao deu certo

falo

20:18 You are already Druid!

20:18 You are already Druid!

20:18 You are already Druid!

20:18 You are already Druid!

VodkartV
28 de julho de 2010 às 20:27

qual o id das voc normal cara?

 

vc soh falou pra vira de rev pra extreme...

 

 

tpw

 

4 > 9 > 13

5 > 10 > 14

6 > 11 > 15

7 > 10 > 16

 

?

Editado Julho 28 por Vodkart

psybreakP
28 de julho de 2010 às 20:29

tipow pode deixa do jeito qi ta mais tem jeito de quando o cara usa o item ele sumir?

tipow so do id 5 ate o 16 :D

akelas vocaçao que começa nao so as MS,EK,RP,ED

AE VAI SUBINDO TIPOW

MS>REVO SORC>EXTREME SORC

CADA VEIZ QUE ELE VAI MUDANDO DE VOCAÇAO O ITEM SOME

axo qi tu ta mo griladao cmg mais vlw ae pela ajuda

 

 

<?xml version="1.0" encoding="UTF-8"?>

<vocations>

<vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="25" gainmanaticks="1" gainmanaamount="40" manamultiplier="1.1" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="1">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="25" gainmanaticks="1" gainmanaamount="40" manamultiplier="1.1" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="2">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="30" gainmanaticks="2" gainmanaamount="35" manamultiplier="1.4" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="35" gainmanaticks="3" gainmanaamount="30" manamultiplier="3.0" attackspeed="800" soulmax="100" gainsoulticks="120" fromvoc="4">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="30" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="600" soulmax="100" gainsoulticks="15" fromvoc="1" lessloss="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="30" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="600" soulmax="100" gainsoulticks="15" fromvoc="2" lessloss="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="45" gainmanaticks="2" gainmanaamount="35" manamultiplier="1.4" attackspeed="600" soulmax="100" gainsoulticks="15" fromvoc="3" lessloss="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="55" gainmanaticks="3" gainmanaamount="45" manamultiplier="3.0" attackspeed="600" soulmax="100" gainsoulticks="15" fromvoc="4" lessloss="3">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>

</vocation>

<vocation id="9" name="Revolution Sorcerer" description="an Revolution sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="1" gainmanaamount="100" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.2" magDamage="1.2" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.3"/>

</vocation>

<vocation id="10" name="Revolution Druid" description="an Revolution druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="1" gainmanaamount="100" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.2" magDamage="1.2" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.3"/>

</vocation>

<vocation id="11" name="Revolution Paladin" description="an Revolution paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="70" gainmanaticks="2" gainmanaamount="75" manamultiplier="1.4" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.2" wandDamage="1.0" magDamage="1.2" magHealingDamage="1.5" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.3"/>

</vocation>

<vocation id="12" name="Revolution Knight" description="an Revolution knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="95" gainmanaticks="3" gainmanaamount="60" manamultiplier="3.0" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="5">

<formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.2" magHealingDamage="1.5" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.3"/>

</vocation>

<vocation id="13" name="Extreme Sorcerer" description="an Extreme sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="1" gainmanaamount="100" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.2" magDamage="1.2" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.5"/>

</vocation>

<vocation id="14" name="Extreme Druid" description="an Extreme druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="40" gainmanaticks="1" gainmanaamount="100" manamultiplier="1.1" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.2" magDamage="1.2" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.5"/>

</vocation>

<vocation id="15" name="Extreme Paladin" description="an Extreme paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="70" gainmanaticks="2" gainmanaamount="75" manamultiplier="1.4" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="5">

<formula meleeDamage="1.0" distDamage="1.2" wandDamage="1.0" magDamage="1.2" magHealingDamage="1.5" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.5"/>

</vocation>

<vocation id="16" name="Extreme Knight" description="an Extreme knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="95" gainmanaticks="3" gainmanaamount="60" manamultiplier="3.0" attackspeed="400" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="5">

<formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.2" magHealingDamage="1.5" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.5"/>

</vocation>

</vocations>

Editado Julho 28 por psybreak

VodkartV
28 de julho de 2010 às 20:35

retirado

Editado Julho 28 por Vodkart

psybreakP
28 de julho de 2010 às 20:39

ID "4" e do knight normal

do DO MS=5,EK=8,RP=7,ED=6

 

tipow ta dano o msm erro

em veiz de subi pra revo knight

ta fazeno e voltar pra knight

Editado Julho 28 por psybreak

VodkartV
28 de julho de 2010 às 20:44

rsrs é verdade

 

function onUse(cid,item,fromPosition,toPosition,itemEx)

local v = getThingPos(cid)

 

 

 

if isInArray({5}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,9)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({6}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,10)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({7}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,11)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({8}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,12)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({9}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,13)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({10}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,14)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({11}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,15)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({12}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,16)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

return TRUE

end

psybreakP
28 de julho de 2010 às 20:50

agora deu certo

 

mais tipow o item nao ta sumindo precisa de algum moviment pra sumir?

VodkartV
28 de julho de 2010 às 21:01

ta ai

era soh adc

doRemoveItem(item.uid, 1)

 

 

 

function onUse(cid,item,fromPosition,toPosition,itemEx)

local v = getThingPos(cid)

 

 

 

if isInArray({5}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,9)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({6}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,10)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({7}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,11)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({8}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,12)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({9}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,13)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({10}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,14)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({11}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,15)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

if isInArray({12}, getPlayerVocation(cid)) then

doPlayerSetVocation(cid,16)

doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')

doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,12)

doRemoveItem(item.uid, 1)

else

doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')

doSendMagicEffect(v,2)

end

 

return TRUE

end

 

MarcelloMendesM
28 de julho de 2010 às 21:04

Criei esse Pra vc, ta 100% do geito que vc quer, removendo item e tudo, testei varias vezes, OBS: "vocÊ não precisa mecher em absolutamente nada, ja configurei pras suas vocaçoes"!

 

actions/scripts

 

criei um arquivo actPromote.lua

 

-- [script By: MarcelloMkez] __ 



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



config = {

promt = 3,   --Numero de Promotions que vc tem, exemplo, sorcerer, Master Sorcerer e etc.  
lvl = 200,   --Level para usar o item.
tempo = 5    --Tempo para o player deslogar apos usa o item.
}

function promote(cid)
setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid)+1)
doRemoveCreature(cid)
return TRUE
end

local msg="Sucesso! Você foi promovido, e sera deslogado em "..config.tempo.." segundos. "    
local msgN="Você Não pode mas ser promovido."

local query = db.getResult("SELECT `vocation` FROM `players` WHERE `id` = "..getPlayerGUID(cid)..";")
local twoQuery = db.getResult("SELECT `promotion` FROM `players` WHERE `id` = "..getPlayerGUID(cid)..";")

if query:getDataInt("vocation") == 0 then
doPlayerPopupFYI(cid, "error; nil Value vocation_") 
return TRUE
end  

if twoQuery:getDataInt("promotion") == config.promt then
doPlayerPopupFYI(cid, msgN) 
return TRUE
end 


 if  getPlayerLevel(cid) >= config.lvl then
 doPlayerPopupFYI(cid, msg)
 doRemoveItem(item.uid, 1)
addEvent(promote, config.tempo * 1000, cid)
else
doPlayerPopupFYI(cid, "Você precisa de level "..config.lvl.." para usar este item.") 
end
return TRUE
end


 

tag actions.xml :

<action itemid="2348" event="script" value="actPromote.lua"/>

 

testa ai i mi fala xD

 

flw

 

OBS: o do Vodkart tbm ta rox =] mas testa ai abraço

Editado Julho 28 por MarcelloMkez

OneshotO
28 de julho de 2010 às 21:07

local config = {
  removeOnUse = true,
  messageType = MESSAGE_STATUS_CONSOLE_ORANGE,
  magicEffect = CONST_ME_MAGIC_BLUE,
}

local vocation = {[5] = 9, [6] = 10, [7] = 11, [8] = 12, [9] = 13, [10] = 14, [11] = 15, [12] = 16}

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if(isInArray({5, 6, 7, 8, 9, 10, 11, 12}, getPlayerVocation(cid))) then
     doPlayerSetVocation(cid, vocation[getPlayerVocation(cid)])
     doPlayerSendTextMessage(cid, config.messageType, "Your vocation has changed to ".. getPlayerVocationName(cid) .."")
     doBroadcastMessage("Player ".. getPlayerByNameWildcard(cid) .." just changed vocation to ".. getPlayerVocationName(cid) .."")
     doSendMagicEffect(config.magicEffect, getThingPosition(cid))
     if(config.removeOnUse ==  true) then
        doRemoveItem(item.uid, 1)
     end
  end
  return true
end

 

Faz a mesma coisa que o script do Vodkart e é bem mais limpo ;D

 

Abraços.

Editado Julho 28 por Oneshot

psybreakP
28 de julho de 2010 às 21:12

ta funcionando certim

mais nao ta sumindo o item :D o do vordkart

 

vlwwwww parceirosssssss

seis sao os cara notta 10000000000000000000000000 pro seis

vlw vodkart,Oneshot, MarcelloMkez

 

 

e como adiciono +rep pro seis

Editado Julho 28 por psybreak

MarcelloMendesM
28 de julho de 2010 às 21:17

clicando no + verdin la embaixo do post okdsakodsakosd

 

testo o meu?

psybreakP
28 de julho de 2010 às 21:18

deu 1 pau no sistema

 

21:17 Your vocation has changed to Revolution Paladin

21:17 Your vocation has changed to Extreme Paladin

21:17 Your vocation has changed to Extreme Knight

21:18 You are Unknown (======|======)

21:18 Your vocation has changed to None

21:18 Your vocation has changed to None

21:18 Your vocation has changed to None

 

 

o do MarcelloMkez deu certo

agora do Oneshot

vai clicando e clicando ele vai voltando ate chega none :D

Editado Julho 28 por psybreak