What's new

Mods [mod] Green Mana Potion

Status
Not open for further replies.

iSanto

Demetri-World.net
Joined
Jan 8, 2011
Messages
922
Reaction score
87
Witam,
dzisiaj chcia?bym udost?pni? wam kod, kt?ry dzia?a praktycznie identycznie jak zielone mana potiony na serwerze APO.
Je?eli kto? nie wie, jak one dzia?aj?, zapraszam do obejrzenia filmiku:

[video=youtube;8h97Mwuc-LU]http://www.youtube.com/watch?v=8h97Mwuc-LU[/video]


Jedyn? zmian? jest to, ?e mo?emy ustali? ile chcemy, ?eby nasz mana potion dodawa? nam many na danym poziomie.

np.:
[LUA][1] = {min_lvl=1, max_lvl = 10, min_mp = 40, max_mp = 80},[/LUA]
Od poziomu 1 do 10 dostaniemy od 40 do 80 mp.


Wchodzimy do data/mods i tworzymy plik o nazwie green_mana_potion.xml.
Wklejamy do niego:

Kod:

[XML]<?xml version="1.0" encoding="UTF-8"?>
<mod name="Green_Mana_Potion" version="1.0" author="iSanto" contact="http://tibia.net.pl/members/322409-iSanto" enabled="yes">
<config name="potion_config"><![CDATA[
config = {
[1] = {min_lvl=1, max_lvl = 10, min_mp = 40, max_mp = 80},
[2] = {min_lvl=11, max_lvl = 20, min_mp = 70, max_mp = 90},
[3] = {min_lvl=21, max_lvl = 31, min_mp = 120, max_mp = 150}
}
storage = 4587
seconds = 1.5
secounds = 5
]]>
</config>

<item id="7253" article="a" name="green mana potion vial" override="yes">
<attribute key="description" value="Charges: 255" />
<attribute key="weight" value="180" />
</item>
<item id="7478" article="a" name="green mana potion vial (empty)" override="yes">
<attribute key="decayTo" value="7253" />
<attribute key="duration" value="10" />
<attribute key="weight" value="180" />
</item>
<action itemid="7253" event="script"><![CDATA[
domodlib('potion_config')
if not isPlayer(itemEx.uid) then
return true
end
if exhaustion.get(cid, storage) then
pause = math.floor(((exhaustion.get(cid, storage)) + 1))
doPlayerSendCancel(cid,"You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
end
if item.actionid == 9001 then
doRemoveItem(item.uid)
end
charges = item.actionid
for i=1, #config do
if getPlayerLevel(cid) >= config.min_lvl and getPlayerLevel(cid) <= config.max_lvl then
doCreatureAddMana(cid, math.random(config.min_mp,config.max_mp))
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
exhaustion.set(cid, storage, seconds)
doTransformItem(item.uid, 7478)
doDecayItem(item.uid)
if charges == 0 then
doItemSetAttribute(item.uid, "aid", 9254)
doItemSetAttribute(item.uid, "description", "Charges: 254")
else
doItemSetAttribute(item.uid, "aid", charges-1)
doItemSetAttribute(item.uid, "description", "Charges:"..charges-9000-1)
end
end
end
return true



]]></action>
<action itemid="7478" event="script"><![CDATA[
doPlayerSendCancel(cid,"It's empty.")
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
]]></action>
</mod>[/XML]
 

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp:
Notka moderatorska:
Green Mana Potion

oo fajne mo?e si? przyda, dzi?ki. :)
 

hadEs

Active User
Joined
Aug 27, 2009
Messages
115
Reaction score
5
Odp:
Notka moderatorska:
Green Mana Potion

Ja ,ja ... gut gut !! danke !
 

Dubler

Lua Factory =)
Joined
Apr 8, 2009
Messages
1,874
Reaction score
112
Odp:
Notka moderatorska:
Green Mana Potion

Tez widze zaczales youtubowa? skrypty tak jak ja kiedy? :p Nie warto, po kilku(nastu) Ci sie znudzi
 

Zbizu

Luakami
Joined
Mar 13, 2010
Messages
719
Reaction score
104
Age
28
Odp:
Notka moderatorska:
Green Mana Potion

dodaj do parametr?w item?w w cz??ci z id override="yes" bo b?dzie wywala? b??dy o duplikacie w konsoli je?li dany item jest ju? zarejestrowany
np.
<item id="7253" article="a" name="green mana potion vial" override="yes">
...
</item>
 
Status
Not open for further replies.
Top