TalkAction Buy All blessings

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Best answers
0
Reaction score
1
Location
England
I made a talkaction on my server to buy all blessings for 60k and with a little help from Rizz I got it working, heres the script:
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
Give me reptutation if you liked it :thumbup:
 
Last edited:

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,833
Best answers
0
Reaction score
184
if doPlayerRemoveItem(cid,2160,6) == 1 then
=
if doPlayerRemoveMoney(cid, 60000) == TRUE then
 

Archez

'
Joined
Jun 26, 2008
Messages
6,589
Best answers
1
Reaction score
68
Location
Mexico
But your script will just remove 6 crystal...

Example: if you have 60000 gp...(many backpack) or 600 platinum coins... The script wont remove the money...

So use...
PHP:
if doPlayerRemoveMoney(cid, 60000) == TRUE then
Instead of...
PHP:
if doPlayerRemoveItem(cid,2160,6) == 1 then
:w00t:
 
OP
N

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Best answers
0
Reaction score
1
Location
England
But your script will just remove 6 crystal...

Example: if you have 60000 gp...(many backpack) or 600 platinum coins... The script wont remove the money...

So use...
PHP:
if doPlayerRemoveMoney(cid, 60000) == TRUE then
Instead of...
PHP:
if doPlayerRemoveItem(cid,2160,6) == 1 then
:w00t:
oO I understand now, thanks for explaining it
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,833
Best answers
0
Reaction score
184
Code:
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
=
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [i])
end
 

babalow

Nobody o/
Joined
Nov 7, 2007
Messages
392
Best answers
0
Reaction score
0
Location
Brazil
Code:
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
=
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [i])
end
maybe...
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [COLOR=Red]i[/COLOR])
end
 

Illusion Storm

Zakładam kominiare.
Joined
Aug 28, 2008
Messages
377
Best answers
0
Reaction score
0
I made a talkaction on my server to buy all blessings for 60k and with a little help from Rizz I got it working, heres the script:
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
Give me reptutation if you liked it :thumbup:
Its not your script.
Piotrek1447 make this script :)
 

Doonrak

Banned User
Joined
Mar 2, 2008
Messages
512
Best answers
0
Reaction score
0
Can someone make like its only for premium users?
 

Master-m

Need help? Just ask!
Joined
May 28, 2007
Messages
4,339
Best answers
0
Reaction score
15
Location
The Netherlands
I think this would work, try it :)
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
			if isPremium(cid) == TRUE then
		
				for i = 1,5 do
				doPlayerAddBlessing(cid, i)
				end

				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			
			else
			doPlayerSendCancel(cid, "You need a premium account!")
			end
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
 
OP
N

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Best answers
0
Reaction score
1
Location
England
Actully, this guy made most of it, I just fixed some bugs.
Its kind of annoying not gettin credit for anything, my whole server has been released and I don't get credit anymore.
 

Piotrek1447

Member
Joined
Jun 1, 2007
Messages
658
Best answers
0
Reaction score
16
Location
Rzeszów, Poland
Its not your script.
Piotrek1447 make this script :)
No, this is no mine script, mine script is this:
Code:
[COLOR=#007700]-- ![/COLOR][COLOR=#0000BB]buyBless by Piotrek1447 (Razer)

local bless [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]4[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]5[/COLOR][COLOR=#007700]} -- [/COLOR][COLOR=#0000BB]Don't touch this.[/COLOR][COLOR=#007700]
[/COLOR][COLOR=#0000BB]local cost [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1 [/COLOR][COLOR=#007700]-- [/COLOR][COLOR=#0000BB]Price in gp.[/COLOR][COLOR=#007700]

function [/COLOR][COLOR=#0000BB]onSay[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]words[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]param[/COLOR][COLOR=#007700])
    for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700]) do
        if([/COLOR][COLOR=#0000BB]getPlayerBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]])) [/COLOR][COLOR=#0000BB]then
            doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You have already all blessings."[/COLOR][COLOR=#007700])
            return
        [/COLOR][COLOR=#0000BB]end
    end
    
    [/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000BB]doPlayerRemoveMoney[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]cena[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000BB]TRUE[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000BB]then
        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700]) do
            [/COLOR][COLOR=#0000BB]doPlayerAddBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]])
        [/COLOR][COLOR=#0000BB]end
        doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You bought all blessing."[/COLOR][COLOR=#007700])
    else
        [/COLOR][COLOR=#0000BB]doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You don\'t have enough money."[/COLOR][COLOR=#007700])
    [/COLOR][COLOR=#0000BB]end
end
Yours,
Piotrek1447
[/COLOR]
 

babalow

Nobody o/
Joined
Nov 7, 2007
Messages
392
Best answers
0
Reaction score
0
Location
Brazil
No, this is no mine script, mine script is this:
Code:
[COLOR=#007700]-- ![/COLOR][COLOR=#0000bb]buyBless by Piotrek1447 (Razer)

local bless [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]3[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]4[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]} -- [/COLOR][COLOR=#0000bb]Don't touch this.[/COLOR][COLOR=#007700]
[/COLOR][COLOR=#0000bb]local cost [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1 [/COLOR][COLOR=#007700]-- [/COLOR][COLOR=#0000bb]Price in gp.[/COLOR][COLOR=#007700]

function [/COLOR][COLOR=#0000bb]onSay[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]words[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]param[/COLOR][COLOR=#007700])
    for [/COLOR][COLOR=#0000bb]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700]) do
        if([/COLOR][COLOR=#0000bb]getPlayerBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700]])) [/COLOR][COLOR=#0000bb]then
            doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You have already all blessings."[/COLOR][COLOR=#007700])
            return
        [/COLOR][COLOR=#0000bb]end
    end
    
    [/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000bb]doPlayerRemoveMoney[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]cena[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]TRUE[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]then
        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000bb]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700]) do
            [/COLOR][COLOR=#0000bb]doPlayerAddBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700]])
        [/COLOR][COLOR=#0000bb]end
        doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You bought all blessing."[/COLOR][COLOR=#007700])
    else
        [/COLOR][COLOR=#0000bb]doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You don\'t have enough money."[/COLOR][COLOR=#007700])
    [/COLOR][COLOR=#0000bb]end
end[/COLOR]


Yours,
Piotrek1447
Wow...
if(doPlayerRemoveMoney(cid, cena) == TRUE) then
WTF is "cena"? ;O
maybe .. cost?

Nice script...
 

Piotrek1447

Member
Joined
Jun 1, 2007
Messages
658
Best answers
0
Reaction score
16
Location
Rzeszów, Poland
Yes yes, i forget to update this, because i edit this script for international members. :D<font color="#0000bb">

PHP:
-- !buyBless by Piotrek1447 (Razer)

local bless = {1, 2, 3, 4, 5} -- Don't touch this.
local cost = 1 -- Price in gp.

function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return
        end
    end
    
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendCancel(cid, "You bought all blessing.")
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
end
 
Last edited:

Olddies

www.tibianas.com
Joined
Nov 21, 2009
Messages
856
Best answers
5
Reaction score
157
Location
Rep.Dom
Someone Have Script For Bless In Version 7.6? Avesta Or Npc Who Can Sell Them I Realy Need It i'll Rep+ Who Help ME!
 

Waller

gogo
Joined
Jun 19, 2008
Messages
766
Best answers
0
Reaction score
13
Location
Sweden
I think this would work, try it :)
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
			if isPremium(cid) == TRUE then
		
				for i = 1,5 do
				doPlayerAddBlessing(cid, i)
				end

				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			
			else
			doPlayerSendCancel(cid, "You need a premium account!")
			end
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
If I use this script, what is the command in-game?
 

JuanC

New Member
Joined
Sep 24, 2009
Messages
220
Best answers
0
Reaction score
2
How i can set this in a NPC Blesser?
 
Top