What's new

Mods Zaawansowany Exp Scroll

Status
Not open for further replies.

Raa

Senior User
Joined
Aug 9, 2009
Messages
715
Reaction score
50
Age
29
Witam. Dzisiaj oddaj? w wasze r?ce jeden z moich skrypt?w, kt?re powsta?y na rzecz Raaevo. Mianowicie chodzi tu o exp scrolla.

Zaawansowany Exp Scroll
Uc6M212.PNG


--

WJCntQ1.PNG


Jest to przedmiot kt?ry daje nam 6 godzin expienia z podw?jnym expem.. ale!
Czas kt?ry mamy do wykorzystania mo?e by? przez nas dowolnie zatrzymywany i wznawiany. Od tego s? specjalne komendy "!expscroll on" i "!expscroll off".
Wi?c je?eli postanowimy sobie pogada? pod depo etc. to mo?emy zatrzyma? czas i wznowi? kiedy nam to b?dzie potrzebne. Dodatowo wpisuj?c "!expscroll" mo?emy sprawdzi? ile nam zosta?o czasu.
oN153D3.PNG


--

je4pWu5.PNG


--

Po wpisaniu "!expscroll off"
YTXLZJ4.PNG


u70G9k6.PNG




[LUA]<?xml version="1.0" encoding="utf-8"?>
<mod name="Exp Scroll" version="1.0" author="Rabbcio/Raa" contact="" enabled="yes">
<config name="Exp_Scroll"><![CDATA[
config = {
rate = 2,
storage = 5422,
register = 5424,
time = 3600*7,
on=5425
}
function isOn(cid)
if getPlayerStorageValue(cid, config.on) >0 then
return true
else
return false
end
end

]]></config>
<action itemid='9004' event='script'><![CDATA[
domodlib('Exp_Scroll')
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) <= 0 then
local rates = getExperienceStage(getPlayerLevel(cid))
setPlayerStorageValue(cid, config.register, 1)
doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x * former experience rate.", TALKTYPE_ORANGE_1, true, cid)
doPlayerSendTextMessage(cid, 22, "start")
doPlayerSetStorageValue(cid, config.storage, config.time+ os.time())
doPlayerSetStorageValue(cid, config.on, 1)
doPlayerSetStorageValue(cid, config.register, 1)
registerCreatureEvent(cid, "exp scroll think")
doPlayerSetExperienceRate(cid, config.rate)
doRemoveItem(item.uid,1)
else
doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid)
end
return true
end ]]></action>
<event type="think" name="exp scroll think" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onThink(cid, interval)
if getPlayerStorageValue(cid, config.register) == 1 then
if getPlayerStorageValue(cid, config.storage) <= os.time() then
doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid)
setPlayerStorageValue(cid, config.storage, 0)
setPlayerStorageValue(cid, config.register, 0)
doPlayerSetStorageValue(cid, config.on, 0)
doPlayerSetExperienceRate(cid,1)

unregisterCreatureEvent(cid, "exp scroll think")
end
end
return true
end ]]></event>


<event type="login" name="exp scroll login" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onLogin(cid)
if not isOn(cid) then
return true
end
if getPlayerStorageValue(cid, config.register) == 1 then
registerCreatureEvent(cid, "exp scroll think")

doPlayerSendTextMessage(cid, 22, "You stil have "..getClock(getPlayerStorageValue(cid, config.storage)+os.time())..".")
doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
--if getPlayerStorageValue(cid, config.storage) < time then
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+ os.time())
--end
if getPlayerStorageValue(cid, config.storage) > os.time() then
doPlayerSetExperienceRate(cid, config.rate)
end
end
return true
end ]]></event>
<event type="logout" name="exp scroll logout" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onLogout(cid)
if not isOn(cid) then
return true
end
if getPlayerStorageValue(cid, config.register) == 1 then
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)- os.time())
end
return true
end
]]>
</event>
<talkaction words='!expscroll' event='script'><![CDATA[
domodlib('Exp_Scroll')
function onSay(cid, words, param, channel)
if getPlayerStorageValue(cid, config.storage)<=0 then
doPlayerSendTextMessage(cid, 22, "You didn't use Exp Scroll.")
return true
end

if param=='' or param=='time' then
if not isOn(cid) then
doPlayerSendTextMessage(cid, 22, "You stil have "..getClock(getPlayerStorageValue(cid, config.storage)+os.time())..""..config.rate.."x exp.")
doPlayerSendTextMessage(cid, 22, "Exp Scroll now is off. Write '!expscroll on' to active it.")
return true
end
doPlayerSendTextMessage(cid, 22, "You stil have "..getClock(getPlayerStorageValue(cid, config.storage))..""..config.rate.."x exp.")
elseif param=='off' or param=='stop' then
if not isOn(cid) then
doPlayerSendTextMessage(cid, 22, "Exp Scroll is still off.")
return true
end
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)- os.time())
doPlayerSetStorageValue(cid, config.on, 0)
doPlayerSetExperienceRate(cid, 1)
unregisterCreatureEvent(cid, "exp scroll think")
doPlayerSendTextMessage(cid, 22, "stop")
return true
elseif param=='on' or param=='start' then
if isOn(cid) then
doPlayerSendTextMessage(cid, 22, "Exp Scroll is still on.")
return true
end
doPlayerSendTextMessage(cid, 22, "start")
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+ os.time())
doPlayerSetStorageValue(cid, config.on, 1)
registerCreatureEvent(cid, "exp scroll think")
doPlayerSetExperienceRate(cid, 2)
return true
end

return true
end
]]></talkaction>
</mod>[/LUA]


#ps
Pisa?em go dosy? dawno i teraz jak tak na niego poatrz?, to s?dz?, ?e mo?na by go by?o nieco zoptymalizowa?.
 

DiabloTRZP

User
Joined
Dec 18, 2012
Messages
26
Reaction score
0
Odp: Zaawansowany Exp Scroll

gdzie co jak trzeba doda? * co gdzie stworzyc *, p?jdzie to pod 8.50 otsa?
 

Kahras

Senior User
Joined
Aug 26, 2011
Messages
2,714
Reaction score
167
Age
25
Odp: Zaawansowany Exp Scroll

Chyba b?dzie dzia?a? musisz to wklei? do folderu mods o ile go masz.
 

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp: Zaawansowany Exp Scroll

Dzi?ki jutro zobacz? czy dzia?a. A mo?na go u?ywa? wi?cej ni? 1 raz? bo aktualnie mam jaki? skrypt co tylko raz mo?na u?y?;/
 

Raa

Senior User
Joined
Aug 9, 2009
Messages
715
Reaction score
50
Age
29
Odp: Zaawansowany Exp Scroll

U?yjesz jednego, dostajesz 6 godzin podw?jnego expa, a nast?pnie mo?esz u?y? kolejnego.
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Zaawansowany Exp Scroll

Nie wiem czy wszystko dobrze poprawi?em. Pierwszy raz w ?yciu widz? funkcj? getClock i nie wiem czy u wszystkich b?dzie ona dzia?a?.
[lua]<?xml version="1.0" encoding="utf-8"?>
<mod name="Exp Scroll" version="1.1" author="Rabbcio/Raa/Oskar" contact="oskar1121@gmail.com / http://forum.otslist.eu/" enabled="yes">
<config name="Exp_Scroll"><![CDATA[
config = {
rate = 2,
storage = 5422,
time = 3600 * 7,
on = 5425
}
function isOn(cid)
return getCreatureStorage(cid, config.on) > 0
end

function getStillTime(cid)
return getClock(getCreatureStorage(cid, config.storage) + os.time())
end
]]></config>

<action itemid='9004' event='script'><![CDATA[
domodlib('Exp_Scroll')
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreatureStorage(cid, config.storage) <= 0 then
local rates = getExperienceStage(getPlayerLevel(cid))
doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x * former experience rate.", TALKTYPE_ORANGE_1, true, cid)
doCreatureSetStorage(cid, config.storage, config.time+ os.time())
doCreatureSetStorage(cid, config.on, 1)
registerCreatureEvent(cid, "expScrollThink")
doPlayerSetExperienceRate(cid, config.rate)
return doRemoveItem(item.uid, 1)
else
return doCreatureSay(cid, "You must finish first exp condition to start other exp condition!", TALKTYPE_ORANGE_1, true, cid)
end
return true
end
]]></action>

<event type="think" name="expScrollThink" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onThink(cid, interval)
if isOn(cid) and getCreatureStorage(cid, config.storage) <= os.time() then
doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid)
doCreatureSetStorage(cid, config.storage, 0)
doCreatureSetStorage(cid, config.on, 0)
return doPlayerSetExperienceRate(cid, 1)
end
return true
end
]]></event>

<event type="login" name="expScrollLogin" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onLogin(cid)
if not isOn(cid) then
return true
end
if isOn(cid) then
registerCreatureEvent(cid, "expScrollThink")
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You stil have "..getStillTime(cid)..".")
doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
if getCreatureStorage(cid, config.storage) > os.time() then
return doPlayerSetExperienceRate(cid, config.rate)
end
end
return true
end
]]></event>

<event type="logout" name="exp scroll logout" event="script"><![CDATA[
domodlib('Exp_Scroll')
function onLogout(cid)
if not isOn(cid) then
return true
end
return doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) - os.time())
end
]]></event>

<talkaction words='!expscroll' event='script'><![CDATA[
domodlib('Exp_Scroll')
function onSay(cid, words, param, channel)
if getCreatureStorage(cid, config.storage) <= 0 then
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You didn't use Exp Scroll.")
end
if isInArray({'', 'time'}, param:lower()) then
if not isOn(cid) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Exp Scroll now is off. Write '!expscroll on' to active it.")
end
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You stil have "..getStillTime(cid).." "..config.rate.."x exp.")
elseif isInArray({'off', 'stop'}, param:lower()) then
if not isOn(cid) then
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Exp Scroll is still off.")
end
doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) - os.time())
doCreatureSetStorage(cid, config.on, 0)
doPlayerSetExperienceRate(cid, 1)
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Stop.")
elseif isInArray({'on', 'start'}, param:lower()) then
if isOn(cid) then
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Exp Scroll is still on.")
end
doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage)+ os.time())
doCreatureSetStorage(cid, config.on, 1)
doPlayerSetExperienceRate(cid, 2)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Start.")
return registerCreatureEvent(cid, "expScrollThink")
end
return true
end
]]></talkaction>
</mod>[/lua]
 
  • Like
Reactions: Raa

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp: Zaawansowany Exp Scroll

A umia?by kto? zrobi? pod reva 5759 9.83? B??d mi wyskakuje w 1 linijce xd Nie testowa?em na 8.6 jakby co.
 

Raa

Senior User
Joined
Aug 9, 2009
Messages
715
Reaction score
50
Age
29
Odp: Zaawansowany Exp Scroll

Jaki b??d?
Nie powinno by? ?adnego b??du.
 

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp: Zaawansowany Exp Scroll

@Up: A no taki b??d te? mnie to dziwi czemu nie dzia?a...
 

zimoo

User
Joined
Aug 26, 2010
Messages
31
Reaction score
1
Odp: Zaawansowany Exp Scroll

mi ten sam blad wywala na alissow ots 8.6
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Zaawansowany Exp Scroll

Mo?liwe, ?e kodowanie jest nieodpowiednie.
Zmie?cie:
[lua]<?xml version="1.0" encoding="utf-8"?>[/lua]
Na:
[lua]<?xml version="1.0" encoding="ISO-8859-1"?>[/lua]
 

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp: Zaawansowany Exp Scroll

Dalej ten sam b??d. ;/
 
Status
Not open for further replies.
Top