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

TalkAction Auto-buy AOL and/or bless after death

PhoOwned

^_^
Joined
Nov 11, 2010
Messages
375
Reaction score
66
Always newest version:
phoowned-scripts - Revision 3: /trunk/SERVER/TFS_0_3/LUA/talkactions/auto_aol_bless_buyer

Script add AoL/bless after player death ;)
If player say /bless he get 5 bless for 50k
If player say /bless on he will get 5 bless always after death (if he will have 50k gp).
If player say /bless off he will not get 5 bless after death.
Same for !aol (cost 10k).
in data/creaturescripts/creaturescripts.xml add:
XML:
<event type="login" name="AutoBuyerAfterDeath" event="script" value="autobuyer.lua"/>
create file data/creaturescripts/scripts/autobuyer.lua and paste:
Lua:
--#################################################
--### Scripted by PhoOwned                      ###
--### Contact: [email][email protected][/email]                   ###
--###                                           ###
--### Auto AOL and / or Bless buyer after death ###
--### version: 1.1                              ###
--#################################################

local autoBlessStorage = 57927
local autoAOLStorage = 57928

function onLogin(cid)
	local templePosition = getTownTemplePosition(getPlayerTown(cid))
	local playerPosition = getThingPosition(cid)
	local fyi = {}
	local msg = {}
	if(getDistanceBetween(templePosition, playerPosition) <= 2) then
		if(getCreatureStorage(cid, autoAOLStorage) == 1 and getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 0) then
			if(doPlayerRemoveMoney(cid,10000)) then
				doPlayerAddItem(cid,2173,1)
				doCreatureSay(cid,'AOL',TALKTYPE_ORANGE_1)
				doSendMagicEffect(getThingPosition(cid),CONST_ME_BATS)
				table.insert(msg, 'You have bought Amulet of Loss!')
			else
				table.insert(fyi, 'You got no money for Amulet of Loss! It cost 1 crystal coin!')
			end
		end
		if(getCreatureStorage(cid, autoBlessStorage) == 1 and not getPlayerBlessing(cid,1)) then
			if(doPlayerRemoveMoney(cid,50000)) then
				for b=1,5 do
					doPlayerAddBlessing(cid,b)
				end
				doCreatureSay(cid,'BLESS',TALKTYPE_ORANGE_1)
				doSendMagicEffect(getThingPosition(cid),CONST_ME_HOLYDAMAGE)
				table.insert(msg, 'You have been blessed by the gods!')
			else
				table.insert(fyi, 'You got no money for Bless! It cost 5 crystal coin!')
			end
		end
	end
	if(#fyi > 0) then
		doPlayerPopupFYI(cid, table.concat(fyi, '\n'))
	end
	if(#msg > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, table.concat(msg, '\n'))
	end
	if(#msg > 0 or #fyi > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can turn off auto buyer by commands:\n!aol off\n!bless off')
	end
	return true
end
in data/talkactions/talkactions.xml add:
XML:
<talkaction words="!aol; /aol" case-sensitive="no" event="script" value="aol.lua"/>
<talkaction words="!bless; /bless" case-sensitive="no" event="script" value="bless.lua"/>
create file data/talkactions/scripts/aol.lua and paste:
Lua:
--#################################################
--### Scripted by PhoOwned                      ###
--### Contact: [email][email protected][/email]                   ###
--###                                           ###
--### Auto AOL and / or Bless buyer after death ###
--### version: 1.1                              ###
--#################################################

local autoAOLStorage = 57928

function onSay(cid, words, param)
	if(param == '1' or param == 'on') then
		doCreatureSetStorage(cid, autoAOLStorage, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Auto-buy AOL after death - ON!')
	elseif(param == '0' or param == 'off') then
		doCreatureSetStorage(cid, autoAOLStorage)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Auto-buy AOL after death - OFF!')
	elseif(param == '') then
		if(doPlayerRemoveMoney(cid,10000)) then
			doPlayerAddItem(cid,2173,1)
			doCreatureSay(cid,'AOL',TALKTYPE_ORANGE_1)
			doSendMagicEffect(getThingPosition(cid),CONST_ME_BATS)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have bought Amulet of Loss!')
		else
			doSendMagicEffect(getThingPosition(cid),CONST_ME_POFF)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"You need 1 crystal coin to get AOL!")
		end
	else
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Wrong param')
	end    
	return 1
end
create file data/talkactions/scripts/bless.lua and paste:
Lua:
--#################################################
--### Scripted by PhoOwned                      ###
--### Contact: [email][email protected][/email]                   ###
--###                                           ###
--### Auto AOL and / or Bless buyer after death ###
--### version: 1.1                              ###
--#################################################

local autoBlessStorage = 57927

function onSay(cid, words, param)
	if(param == '1' or param == 'on') then
		doCreatureSetStorage(cid, autoBlessStorage, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Auto-buy bless after death - ON!')
	elseif(param == '0' or param == 'off') then
		doCreatureSetStorage(cid, autoBlessStorage)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Auto-buy bless after death - OFF!')
	elseif(param == '') then
		if(getPlayerBlessing(cid,1)) then
			doPlayerSendCancel(cid,'You are blessed!')
		elseif(doPlayerRemoveMoney(cid,50000)) then
			for b=1,5 do
				doPlayerAddBlessing(cid,b)
			end
			doCreatureSay(cid,'BLESS',TALKTYPE_ORANGE_1)
			doSendMagicEffect(getThingPosition(cid),CONST_ME_HOLYDAMAGE)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
		else
			doSendMagicEffect(getThingPosition(cid),CONST_ME_POFF)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"You need 5 crystal coin to get blessed!")
		end
	else
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Wrong param')
	end    
	return 1
end
 
Last edited:
Will be better this way:

Lua:
<talkaction words="!bless; /bless" case-sensitive="no" event="script" value="bless.lua"/>

Something like that .
 
Will be better this way:

Lua:
<talkaction words="!bless; /bless" case-sensitive="no" event="script" value="bless.lua"/>

Something like that .
Thanks. I forgot about this talkactions param :p
First post updated.
 
sry but this script is usefull becuse for????

just remove the itemloss on death and you dont need the aol

its like haveing an effect and then remove it ^.-
 
sry but this script is usefull becuse for????

just remove the itemloss on death and you dont need the aol

its like haveing an effect and then remove it ^.-
Some players buy AoL, others not. If you host server with exp x999999 every player got milions cc, but on low exp servers (x5-15) sometimes even 500 lvl doesn't have money for bless... Low levels buy aol/bless when they get money, high level rich players want to buy AoL and bless after every death and that's why I made this script.
 
Back
Top