Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CW_Pokes = {
- ["bulbasaur"] = {DB_Balls = 10001, DB_PK = 20001, DE_Portrait = 7593, P_Experience = 5000},
- ["ivysaur"] = {DB_Balls = 10002, DB_PK = 20002, DE_Portrait = 7594, P_Experience = 10000},
- ["venusaur"] = {DB_Balls = 10003, DB_PK = 20003, DE_Portrait = 7595, P_Experience = 15000},
- }
- CW_Balls = {
- ["normal"] = "pb",
- ["great"] = "gb",
- ["super"] = "sb",
- ["ultra"] = "ub",
- }
- -------- Functions ----------
- function CW_Setup(cid, pokeName)
- local name = nil
- if tostring(pokeName) then
- name = pokeName:lower()
- else
- name = getCreatureName(pokeName):lower()
- end
- local pk = CW_Pokes[name]
- if pk then
- if getPlayerStorageValue(cid, pk.DB_Balls) <= 0 then
- setPlayerStorageValue(cid, pk.DB_Balls, "pb=0,gb=0,sb=0,ub=0,")
- end
- end
- return true
- end
- function CW_Count(cid, pokeName, ball)
- local name = nil
- if tostring(pokeName) then
- name = pokeName:lower()
- else
- name = getCreatureName(pokeName):lower()
- end
- local txt = getPlayerStorageValue(cid, CW_Pokes[name].DB_Balls)
- local change = txt:match(CW_Balls[ball].."=(.-),")
- local num = tonumber(change)
- local ret = string.gsub(txt, CW_Balls[ball].."="..num, CW_Balls[ball].."="..num+1)
- return setPlayerStorageValue(cid, CW_Pokes[name].DB_Balls, ret) and true
- end
- function CW_Caught(cid, pokeName)
- local name = nil
- if tostring(pokeName) then
- name = pokeName:lower()
- else
- name = getCreatureName(pokeName):lower()
- end
- local pk = CW_Pokes[name]
- if pk then
- if getPlayerStorageValue(cid, pk.DB_PK) <= 0 then
- doPlayerSendCancel(cid, "%#CatchWindow@"..pk.DE_Portrait.."@"..pokeName.."@"..pk.P_Experience.."@"..getPlayerStorageValue(cid, pk.DB_Balls))
- setPlayerStorageValue(cid, pk.DB_Balls, "pb=0,gb=0,sb=0,ub=0,")
- doPlayerAddExp(cid, pk.P_Experience)
- setPlayerStorageValue(cid, pk.DB_PK, 1)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement