• 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!

Npc banker without pacc

tim26

Member
Joined
Aug 12, 2008
Messages
618
Reaction score
11
Location
Poland
i heabe this script by morhamer

Code:
----------------------------------------------------------Made By MokerHamer----------------------------------------------
--------------------Special Thanks to: Talaturen and Jiddo  without them i coulden't have done this!------------------
------------------------------------------NOTE* THIS SCRIPT MAY ONLY BE RELEASED ON WWW.OTLAND.NET ONLY---------------------
------------------------------------This Script is specialde made for World Of Tramon V8.0-----------------------------
-----------------------------------------------------World Of Tramon Link: None Yet--------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end
 
 
---------Begin-Dont--Tough!--Noob--censative
function creatureSayCallback(cid, type, msg)
    if(npcHandler.focus ~= cid) then
        return false
    end
 
    local count = (getCount(msg))        
    local oldcount = getPlayerStorageValue(cid, 300)
    if(oldcount == -1) then
     oldcount = 0
      end
---------End-Dont--Tough!--Noob--censative
 
 
 
---------------Begin  Crap that u can change it if u want-----------------------    
        bank_need_premium = 'Sorry, You need premium account to use the bank.'
        low_money_deposit = 'You do not have enough money in your deposit to withdraw, '..count..' Gold Pieces. '
        lost_track = 'Huh, What are you talking about?'
 
        if msgcontains(msg, 'banker') then
            selfSay('Hello. How can I help you? If you need some help just say information')
        elseif msgcontains(msg, 'information') then
            selfSay('Hello i am the city banker, you can do many things here like, Check your balance deposit and even withdraw!')
---------------End  Crap that u can change it if u want
 
-------------------------------------------------------------Begin of the Banker script---------------------------------------
 
------------------------Begin!--deposit--Crap----
            elseif msgcontains(msg, 'deposit') then
            if getPlayerPremiumDays(cid) > 0 then
            selfSay('How mutch would u like to deposit?')
                    talk_state = 1
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---deposit--Confurm--Yes
elseif isNumber(getCount(msg)) and talk_state == 1 then
talk_state = 0
if doPlayerRemoveMoney(cid, count) == TRUE then
setPlayerStorageValue(cid,300, oldcount+count)
selfSay('You have successfully deposit '..count..' Gold Pieces')
else
selfSay(lost_track)
end
------------------------End!--deposit--Crap----
 
------------------------Begin!--Balance--Crap----
            elseif msgcontains(msg, 'balance') then
            if getPlayerPremiumDays(cid) > 0 then
            selfSay('do u want to check your balance?')
                    talk_state = 2
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---Balance--Confurm--Yes
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerStorageValue(cid,300, oldcount) then
if(oldcount == -1) then
   oldcount = 0
   end
selfSay('You have '..oldcount..' Gold Pieces deposit.')
else
   selfSay(lost_track)
end
------------------------End!--Balance--Crap----
 
------------------------Begin!--withdraw--Crap----
            elseif msgcontains(msg, 'withdraw') then
            if getPlayerPremiumDays(cid) > 0 then
            selfSay('How mutch would u like to withdraw?')
                    talk_state = 3
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---withdraw--Confurm--Yes
elseif isNumber(getCount(msg)) and talk_state == 3 then
talk_state = 0
if count <= oldcount then
setPlayerStorageValue(cid,300, oldcount-count)
doPlayerAddMoney(cid, count)
selfSay('You have successfully withdrawed '..count..' Gold Pieces.')
else
selfSay(low_money_deposit)
end
------------------------End!--withdraw--Crap----
 
---No--To--All
        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
            selfSay('Why the fuck dit you start this conversation anywais?')
            talk_state = 0
            end
 
        return true
           end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

and what i must do to buy pacc without pacc because also if i selete some line i got errors
 
So basically you want it to allow free accounts aswell? If that's the case, try this piece of code:
PHP:
----------------------------------------------------------Made By MokerHamer----------------------------------------------
--------------------Special Thanks to: Talaturen and Jiddo  without them i coulden't have done this!------------------
------------------------------------------NOTE* THIS SCRIPT MAY ONLY BE RELEASED ON WWW.OTLAND.NET ONLY---------------------
------------------------------------This Script is specialde made for World Of Tramon V8.0-----------------------------
-----------------------------------------------------World Of Tramon Link: None Yet--------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end
 
 
---------Begin-Dont--Tough!--Noob--censative
function creatureSayCallback(cid, type, msg)
    if(npcHandler.focus ~= cid) then
        return false
    end
 
    local count = (getCount(msg))        
    local oldcount = getPlayerStorageValue(cid, 300)
    if(oldcount == -1) then
     oldcount = 0
      end
---------End-Dont--Tough!--Noob--censative
 
 
 
---------------Begin  Crap that u can change it if u want-----------------------
        bank_need_premium = 'Sorry you need premium to use the bank'
        low_money_deposit = 'You do not have enough money in your deposit to withdraw, '..count..' Gold Pieces. '
        lost_track = 'Huh, What are you talking about?'
 
        if msgcontains(msg, 'banker') then
            selfSay('Hello. How can I help you? If you need some help just say information')
        elseif msgcontains(msg, 'information') then
            selfSay('Hello i am the city banker, you can do many things here like, Check your balance deposit and even withdraw!')
---------------End  Crap that u can change it if u want
 
-------------------------------------------------------------Begin of the Banker script---------------------------------------
 
------------------------Begin!--deposit--Crap----
            elseif msgcontains(msg, 'deposit') then
            if getPlayerPremiumDays(cid) >= 0 then
            selfSay('How much would u like to deposit?')
                    talk_state = 1
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---deposit--Confurm--Yes
elseif isNumber(getCount(msg)) and talk_state == 1 then
talk_state = 0
if doPlayerRemoveMoney(cid, count) == TRUE then
setPlayerStorageValue(cid,300, oldcount+count)
selfSay('You have successfully deposit '..count..' Gold Pieces')
else
selfSay(lost_track)
end
------------------------End!--deposit--Crap----
 
------------------------Begin!--Balance--Crap----
            elseif msgcontains(msg, 'balance') then
            if getPlayerPremiumDays(cid) >= 0 then
            selfSay('do u want to check your balance?')
                    talk_state = 2
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---Balance--Confurm--Yes
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerStorageValue(cid,300, oldcount) then
if(oldcount == -1) then
   oldcount = 0
   end
selfSay('You have '..oldcount..' Gold Pieces deposit.')
else
   selfSay(lost_track)
end
------------------------End!--Balance--Crap----
 
------------------------Begin!--withdraw--Crap----
            elseif msgcontains(msg, 'withdraw') then
            if getPlayerPremiumDays(cid) >= 0 then
            selfSay('How mutch would u like to withdraw?')
                    talk_state = 3
            else
                selfSay(bank_need_premium)
                talk_state = 0
            end
---withdraw--Confurm--Yes
elseif isNumber(getCount(msg)) and talk_state == 3 then
talk_state = 0
if count <= oldcount then
setPlayerStorageValue(cid,300, oldcount-count)
doPlayerAddMoney(cid, count)
selfSay('You have successfully withdrawed '..count..' Gold Pieces.')
else
selfSay(low_money_deposit)
end
------------------------End!--withdraw--Crap----
 
---No--To--All
        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
            selfSay('Why the fuck dit you start this conversation anywais?')
            talk_state = 0
            end
 
        return true
           end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Basically what I did was a quick and very simple solution, I simply made the premium check, check if the account had 0 or more premium days, if that's the case - it allows you to use the bank.

I could of have done it by removing the checks completely, but this saved me some time, and there's no real difference in it. :)
 
you are aware that this npc will give 255 gold coins when you say "withdraw" "yes" that means that the players can become instantly rich... here is the fixed withdraw part...

Code:
------------------------Begin!--withdraw--Crap----
            elseif msgcontains(msg, 'withdraw') then
            if getPlayerPremiumDays(cid) then
            npcHandler:say('How much would u like to withdraw?')
                    talk_state = 3
            else
                npcHandler:say(bank_need_premium)
                talk_state = 0
            end
---withdraw--Confurm--Yes
elseif isNumber(getCount(msg)) and talk_state == 3 then
talk_state = 0
if count == 0 or count == nil or count == -1 then
npcHandler:say('You want to withdraw 0 gold? you are werid')
else
if count <= oldcount then
setPlayerStorageValue(cid,200, oldcount-count)
doPlayerAddMoney(cid, count)
npcHandler:say('You have successfully withdrawed '..count..' Gold Pieces.')
else
npcHandler:say(low_money_deposit)
end
end
------------------------End!--withdraw--Crap----
 
Back
Top