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:
create file data/creaturescripts/scripts/autobuyer.lua and paste:
in data/talkactions/talkactions.xml add:
create file data/talkactions/scripts/aol.lua and paste:
create file data/talkactions/scripts/bless.lua and paste:
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"/>
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
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"/>
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
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: