Skip to content

Commit

Permalink
Merge pull request #9 from endavis/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
endavis committed Dec 20, 2015
2 parents 29e2470 + 49065a3 commit a4c44a6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
58 changes: 46 additions & 12 deletions Bast/PotionQuafferv2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ To use a heal potion, or mana potion.
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@healdesc) from (.*) for (\d+) gold.$"
match="^You buy (\d*) \* @healdesc from (.*) for (.*) gold.$"
name="Shop_Heal"
regexp="y"
script="Shop_Heal"
Expand All @@ -113,7 +113,18 @@ To use a heal potion, or mana potion.
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@manadesc) from (.*) for (\d+) gold.$"
match="^You buy @healdesc from (.*) for (.*) gold.$"
name="Shop_Heal2"
regexp="y"
script="Shop_Heal"
sequence="50"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy (\d*) \* @manadesc from (.*) for (.*) gold.$"
name="Shop_Mana"
regexp="y"
script="Shop_Mana"
Expand All @@ -124,13 +135,35 @@ To use a heal potion, or mana potion.
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@buffdesc) from (.*) for (\d+) gold.$"
match="^You buy @manadesc from (.*) for (.*) gold.$"
name="Shop_Mana2"
regexp="y"
script="Shop_Mana"
sequence="50"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy (\d*) \* @buffdesc from (.*) for (.*) gold.$"
name="Shop_Buff"
regexp="y"
script="Shop_Buff"
sequence="50"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
ignore_case="y"
match="^You buy @buffdesc from (.*) for (.*) gold.$"
name="Shop_Buff2"
regexp="y"
script="Shop_Buff"
sequence="50"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
Expand Down Expand Up @@ -181,7 +214,7 @@ To use a heal potion, or mana potion.
expand_variables="y"
group="PotionMonitor"
ignore_case="y"
match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@healdesc)\s\((.*)\)$"
match="^\s*\((\s\d|\d*)\)(?:\s?\((\w*)\))*\s*(@healdesc)\s\((.*)\)$"
name="Locate_Heal"
regexp="y"
script="Heal_Found"
Expand All @@ -193,7 +226,7 @@ To use a heal potion, or mana potion.
expand_variables="y"
group="PotionMonitor"
ignore_case="y"
match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@manadesc)\s\((.*)\)$"
match="^\s*\((\s\d|\d*)\)(?:\s?\((\w*)\))*\s*(@manadesc)\s\((.*)\)$"
name="Locate_Mana"
regexp="y"
script="Mana_Found"
Expand All @@ -205,7 +238,7 @@ To use a heal potion, or mana potion.
expand_variables="y"
group="PotionMonitor"
ignore_case="y"
match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@buffdesc)\s\((.*)\)$"
match="^\s*\((\s\d|\d*)\)(?:\s?\((\w*)\))*\s*(@buffdesc)\s\((.*)\)$"
name="Locate_Buff"
regexp="y"
script="Buff_Found"
Expand Down Expand Up @@ -374,6 +407,7 @@ To use a heal potion, or mana potion.

<script>
<![CDATA[
require 'tprint'
function resetvar(var, value, hreset)
if GetVariable(var) == nil or GetVariable(var) == "" or hreset then
Expand All @@ -383,32 +417,32 @@ end
function Shop_Heal(sName,sLine,wildcards)
local num = tonumber(GetVariable("healnum"))
if tonumber(wildcards[3]) == nil then
if tonumber(wildcards[1]) == nil then
num = num + 1
else
num = num + tonumber(wildcards[3])
num = num + tonumber(wildcards[1])
end -- if
SetVariable("healnum",num)
SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
end -- Shop_Heal
function Shop_Mana(sName,sLine,wildcards)
local num = tonumber(GetVariable("mananum"))
if tonumber(wildcards[3]) == nil then
if tonumber(wildcards[1]) == nil then
num = num + 1
else
num = num + tonumber(wildcards[3])
num = num + tonumber(wildcards[1])
end -- if
SetVariable("mananum",num)
SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
end -- Shop_Mana
function Shop_Buff(sName,sLine,wildcards)
local num = tonumber(GetVariable("buffnum"))
if tonumber(wildcards[3]) == nil then
if tonumber(wildcards[1]) == nil then
num = num + 1
else
num = num + tonumber(wildcards[3])
num = num + tonumber(wildcards[1])
end -- if
SetVariable("buffnum",num)
SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
Expand Down
3 changes: 2 additions & 1 deletion Bast/broadcast_cp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ Broadcast 3

<trigger
enabled="y"
match="Commander Barcett tells you 'Type 'campaign info' to see what you must kill.'"
match=".* tells you 'Type 'campaign info' to see what you must kill.'"
sequence="100"
send_to="10"
regexp="y"
script="cp_new"
>
<send>cp check</send>
Expand Down
5 changes: 5 additions & 0 deletions Bast/lua/chardb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ function Statdb:addtostat(stat, add)
if tonumber(add) == 0 then
return true
end
if add == nil then
ColourNote("red", "", "Trying to add a nil value to " .. tostring(stat) .. ", please report this to Bast")
ColourNote("red", "", "please type 'whois' to reset current stats")
return false
end
if self:open('addtostat') then
local tstat = nil
for a in self.db:nrows('SELECT * FROM stats WHERE milestone = "current"') do
Expand Down

0 comments on commit a4c44a6

Please sign in to comment.