parent
1b02c35e1f
commit
092e6df2ce
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
||||
KTracker is a new progress/stat tracker and reporting plugin for MUSHClient, specifically for Aardwolf
|
||||
Currently, this plugin is based on a pup tracker unwillingly provided by Endymion, and heavily modified
|
||||
to provide level tracking, gold tracking, pup tracking, quest tracking, etc.
|
||||
|
||||
The current version requires that you have the following plugins installed:
|
||||
Bast:
|
||||
broadcast_cp.xml
|
||||
broadcast_double.xml
|
||||
broadcast_kills.xml
|
||||
broadcat_quest.xml
|
||||
|
||||
These are available directly from bast's repository along with his other plugins.
|
||||
https://github.com/endavis/bastmush
|
@ -0,0 +1,694 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- $Id$ -->
|
||||
<muclient>
|
||||
<plugin
|
||||
name="xBroadcast_CP"
|
||||
author="Bast"
|
||||
id="aaa66f81c50828bbbfda7100"
|
||||
language="Lua"
|
||||
purpose="Broadcasts when anything happens related to a cp"
|
||||
save_state="y"
|
||||
date_written="2009-02-18 12:31:01"
|
||||
requires="4.73"
|
||||
version="6.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
[FOR PLUGIN AUTHORS ONLY]
|
||||
|
||||
TODO: add a variable to prevent cp check command
|
||||
|
||||
Broadcasts when anything happens in a campaign
|
||||
Broadcasts
|
||||
1 - Mob list, get var.mobs and loadstring it
|
||||
mobs = { 1 = {name = 'Some name', location = 'Some location', clean = 'A name with some stuff removed'},
|
||||
2 = {name = 'Another name', location = 'Another location', clean = 'Another name with some stuff removed'}, }
|
||||
It will be resent when a mob is killed and will be nil when a cp is not active
|
||||
2 - timer, will be updated every 60 seconds, get var.timer and loadstring it
|
||||
timer = {secs = num, text = 'time in text format', days = days, hours = hours, mins = minutes}
|
||||
3 - rewards, get var.rewards and loadstring it, this can also be used to check when a cp is finished
|
||||
see below
|
||||
4 - campaign failed
|
||||
see below
|
||||
5 - just taken new cp
|
||||
|
||||
Example
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "aaa66f81c50828bbbfda7100" and msg == 1 then
|
||||
local pvar = GetPluginVariable( "aaa66f81c50828bbbfda7100", mobs )
|
||||
|
||||
-- get the mobs
|
||||
loadstring( pvar )()
|
||||
cp_mobs = mobs
|
||||
end
|
||||
end
|
||||
|
||||
xBroadcast_CP : Broadcast 1
|
||||
mobs = {}
|
||||
mobs[1] = {}
|
||||
mobs[1].mobdead = false
|
||||
mobs[1].location = "Desert Doom"
|
||||
mobs[1].name = "Tjac's personal advisor"
|
||||
mobs[1].clean = "tjac's personal advisor"
|
||||
mobs[2] = {}
|
||||
mobs[2].mobdead = false
|
||||
mobs[2].location = "Desert Doom"
|
||||
mobs[2].name = "A Sunset herbalist"
|
||||
mobs[2].clean = "a sunset herbalist"
|
||||
mobs[3] = {}
|
||||
mobs[3].mobdead = false
|
||||
mobs[3].location = "Desert Doom"
|
||||
mobs[3].name = "A Sunset scavenger"
|
||||
mobs[3].clean = "a sunset scavenger"
|
||||
mobs[4] = {}
|
||||
mobs[4].mobdead = false
|
||||
mobs[4].location = "Desert Doom"
|
||||
mobs[4].name = "A Sunrise warrior"
|
||||
mobs[4].clean = "a sunrise warrior"
|
||||
mobs[5] = {}
|
||||
mobs[5].mobdead = false
|
||||
mobs[5].location = "Desert Doom"
|
||||
mobs[5].name = "A Sunrise guard"
|
||||
mobs[5].clean = "a sunrise guard"
|
||||
mobs[6] = {}
|
||||
mobs[6].mobdead = false
|
||||
mobs[6].location = "Into the Long Night"
|
||||
mobs[6].name = "an animated body"
|
||||
mobs[6].clean = "an animated body"
|
||||
mobs[7] = {}
|
||||
mobs[7].mobdead = false
|
||||
mobs[7].location = "The Archipelago of Entropy"
|
||||
mobs[7].name = "the playwright"
|
||||
mobs[7].clean = "the playwright"
|
||||
mobs[8] = {}
|
||||
mobs[8].mobdead = false
|
||||
mobs[8].location = "The Casino"
|
||||
mobs[8].name = "Method Man"
|
||||
mobs[8].clean = "method man"
|
||||
mobs[9] = {}
|
||||
mobs[9].mobdead = false
|
||||
mobs[9].location = "The Dark Temple of Zyian"
|
||||
mobs[9].name = "A Eunuch"
|
||||
mobs[9].clean = "a eunuch"
|
||||
mobs[10] = {}
|
||||
mobs[10].mobdead = false
|
||||
mobs[10].location = "The Drageran Empire"
|
||||
mobs[10].name = "Aliza"
|
||||
mobs[10].clean = "aliza"
|
||||
mobs[11] = {}
|
||||
mobs[11].mobdead = false
|
||||
mobs[11].location = "The Slaughter House"
|
||||
mobs[11].name = "Asmodeus"
|
||||
mobs[11].clean = "asmodeus"
|
||||
mobs[12] = {}
|
||||
mobs[12].mobdead = false
|
||||
mobs[12].location = "The Slaughter House"
|
||||
mobs[12].name = "Sepulchrumalum"
|
||||
mobs[12].clean = "sepulchrumalum"
|
||||
mobs[13] = {}
|
||||
mobs[13].mobdead = false
|
||||
mobs[13].location = "Tir na nOg"
|
||||
mobs[13].name = "The goddess Morrigan"
|
||||
mobs[13].clean = "the goddess morrigan"
|
||||
|
||||
xBroadcast_CP : Broadcast 2
|
||||
timer = {}
|
||||
timer.secs = 604620
|
||||
timer.mins = 57
|
||||
timer.text = "1 w"
|
||||
timer.days = 6
|
||||
timer.hours = 23
|
||||
|
||||
Broadcast 3
|
||||
cp_info = {}
|
||||
cp_info.level = "125"
|
||||
cp_info.tp = 0
|
||||
cp_info.qp = "31"
|
||||
cp_info.failed = 0
|
||||
cp_info.oncp = false
|
||||
cp_info.cantake = true
|
||||
cp_info.finishtime = 1340386171
|
||||
cp_info.gold = "23780"
|
||||
cp_info.starttime = 1340385212
|
||||
cp_info.trains = 0
|
||||
cp_info.pracs = 0
|
||||
cp_info.mobs = {}
|
||||
cp_info.mobs[1] = {}
|
||||
cp_info.mobs[1].location = "Faerie Tales II"
|
||||
cp_info.mobs[1].mobdead = false
|
||||
cp_info.mobs[1].name = "the big bad wolf"
|
||||
cp_info.mobs[1].clean = "the big bad wolf"
|
||||
cp_info.mobs[2] = {}
|
||||
cp_info.mobs[2].location = "Faerie Tales II"
|
||||
cp_info.mobs[2].mobdead = false
|
||||
cp_info.mobs[2].name = "the miller's wife"
|
||||
cp_info.mobs[2].clean = "the miller's wife"
|
||||
cp_info.mobs[3] = {}
|
||||
cp_info.mobs[3].location = "Faerie Tales II"
|
||||
cp_info.mobs[3].mobdead = false
|
||||
cp_info.mobs[3].name = "the third little pig"
|
||||
cp_info.mobs[3].clean = "the third little pig"
|
||||
cp_info.mobs[4] = {}
|
||||
cp_info.mobs[4].location = "Gilda And The Dragon"
|
||||
cp_info.mobs[4].mobdead = false
|
||||
cp_info.mobs[4].name = "an ant"
|
||||
cp_info.mobs[4].clean = "an ant"
|
||||
cp_info.mobs[5] = {}
|
||||
cp_info.mobs[5].location = "Sanctity of Eternal Damnation"
|
||||
cp_info.mobs[5].mobdead = false
|
||||
cp_info.mobs[5].name = "a slime"
|
||||
cp_info.mobs[5].clean = "a slime"
|
||||
cp_info.mobs[6] = {}
|
||||
cp_info.mobs[6].location = "The Archipelago of Entropy"
|
||||
cp_info.mobs[6].mobdead = false
|
||||
cp_info.mobs[6].name = "a Kism banker"
|
||||
cp_info.mobs[6].clean = "a kism banker"
|
||||
cp_info.mobs[7] = {}
|
||||
cp_info.mobs[7].location = "The Fabled City of Stone"
|
||||
cp_info.mobs[7].mobdead = false
|
||||
cp_info.mobs[7].name = "Citadel Wizard"
|
||||
cp_info.mobs[7].clean = "citadel wizard"
|
||||
cp_info.mobs[8] = {}
|
||||
cp_info.mobs[8].location = "The Fabled City of Stone"
|
||||
cp_info.mobs[8].mobdead = false
|
||||
cp_info.mobs[8].name = "Grectza"
|
||||
cp_info.mobs[8].clean = "grectza"
|
||||
cp_info.mobs[9] = {}
|
||||
cp_info.mobs[9].location = "The Fortress of Angband"
|
||||
cp_info.mobs[9].mobdead = false
|
||||
cp_info.mobs[9].name = "The orc"
|
||||
cp_info.mobs[9].clean = "the orc"
|
||||
cp_info.mobs[10] = {}
|
||||
cp_info.mobs[10].location = "The Misty Shores of Yarr"
|
||||
cp_info.mobs[10].mobdead = false
|
||||
cp_info.mobs[10].name = "a pirate hunter"
|
||||
cp_info.mobs[10].clean = "a pirate hunter"
|
||||
cp_info.mobs[11] = {}
|
||||
cp_info.mobs[11].location = "The Slaughter House"
|
||||
cp_info.mobs[11].mobdead = false
|
||||
cp_info.mobs[11].name = "a lesser demon"
|
||||
cp_info.mobs[11].clean = "a lesser demon"
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="Welcome to Aardwolf. May your adventures be mystical, challenging and rewarding."
|
||||
sequence="100"
|
||||
send_to="10"
|
||||
>
|
||||
<send>cp check</send>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="############# Reconnecting to Game #############"
|
||||
sequence="100"
|
||||
send_to="10"
|
||||
>
|
||||
<send>cp check</send>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
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>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You are not currently on a campaign."
|
||||
name="cp_none"
|
||||
script="cp_none"
|
||||
sequence="100"
|
||||
group="campaigncheck"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You have * to finish this campaign."
|
||||
name="cp_time"
|
||||
script="cp_time"
|
||||
sequence="100"
|
||||
group="campaigncheck"
|
||||
omit_from_output="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="^You still have to kill(?<num>[ \d]*) \* (?<name>.*?) \((?<location>.*?)(?<dead> - Dead|)\)(|\.)$"
|
||||
name="campaign_item"
|
||||
script="campaign_item"
|
||||
sequence="100"
|
||||
regexp="y"
|
||||
group="campaigncheck"
|
||||
omit_from_output="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You will have to level before you can go on another campaign."
|
||||
send_to="10"
|
||||
sequence="100"
|
||||
script="level"
|
||||
group="campaignin"
|
||||
name="needtolevel"
|
||||
omit_from_output="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You may take a campaign at this level."
|
||||
send_to="10"
|
||||
sequence="100"
|
||||
script="level"
|
||||
group="campaignin"
|
||||
name="cantake"
|
||||
omit_from_output="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You cannot take another campaign for *."
|
||||
send_to="10"
|
||||
sequence="100"
|
||||
script="level"
|
||||
group="campaignin"
|
||||
name="shtime"
|
||||
omit_from_output="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="Congratulations, that was one of your CAMPAIGN mobs!"
|
||||
send_to="10"
|
||||
sequence="100"
|
||||
script="cp_mob_dead"
|
||||
group="campaignin"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="CONGRATULATIONS! You have completed your campaign."
|
||||
sequence="100"
|
||||
script="campaign_complete"
|
||||
group="campaignin"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="^(\s*)Reward of (?<amount>\d+) (?<type>.+) (.+) added.$"
|
||||
sequence="100"
|
||||
script="campaign_reward"
|
||||
group="campaignrew"
|
||||
regexp="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="--------------------------------------------------------------"
|
||||
sequence="100"
|
||||
script="campaign_done"
|
||||
group="campaigndone"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="*"
|
||||
name="catchall"
|
||||
script="nextline"
|
||||
group="getnextline"
|
||||
sequence="101"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="Campaign cleared."
|
||||
sequence="100"
|
||||
script="campaign_fail"
|
||||
group="campaignin"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
|
||||
<!-- Aliases -->
|
||||
|
||||
<aliases>
|
||||
<alias
|
||||
name="cp_check"
|
||||
script="cp_check"
|
||||
match="^(cp|campaign) check$"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
<send>cp check</send>
|
||||
</alias>
|
||||
|
||||
</aliases>
|
||||
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
<timers>
|
||||
<timer
|
||||
script="update_timer"
|
||||
enabled="n"
|
||||
second="59.00"
|
||||
name="cp_timer"
|
||||
>
|
||||
</timer>
|
||||
<timer
|
||||
script="mob_timer"
|
||||
enabled="n"
|
||||
minute="5"
|
||||
name="mob_timer"
|
||||
>
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
internalrevision = "$Rev$"
|
||||
|
||||
dofile (GetPluginInfo (GetPluginID (), 20) .. "luapath.lua")
|
||||
|
||||
require "var"
|
||||
require "pluginhelper"
|
||||
require "serialize"
|
||||
require "commas"
|
||||
require "verify"
|
||||
require "copytable"
|
||||
require "ldplugin"
|
||||
require "utils"
|
||||
|
||||
rewardtable = {
|
||||
quest = 'qp',
|
||||
training = 'trains',
|
||||
gold = 'gold',
|
||||
trivia = 'tp',
|
||||
practice = 'pracs',
|
||||
}
|
||||
|
||||
char = {}
|
||||
cp_info = {}
|
||||
mobsleft = {}
|
||||
timer = {}
|
||||
curlevel = -1
|
||||
|
||||
function cleanname(name)
|
||||
return string.lower(string.gsub(name, ",", ""))
|
||||
end
|
||||
|
||||
function level(name, line, wildcards)
|
||||
if name == 'cantake' then
|
||||
cp_info['cantake'] = true
|
||||
elseif name == 'shtime' then
|
||||
cp_info['shtime'] = wildcards[1]
|
||||
end
|
||||
end
|
||||
|
||||
function campaign_item (name, line, wildcards)
|
||||
name = wildcards.name
|
||||
mobdead = false
|
||||
location = wildcards.location
|
||||
if wildcards.dead == ' - Dead' then
|
||||
mobdead = true
|
||||
end
|
||||
if mobdead then
|
||||
if GetTimerInfo("mob_timer", 6) == false then
|
||||
check(EnableTimer("mob_timer", true))
|
||||
end
|
||||
end
|
||||
if not name or not location then
|
||||
print("error parsing line: ", line)
|
||||
tprint(wildcards)
|
||||
else
|
||||
table.insert(mobsleft, {name=name, location=location, clean=cleanname(name), mobdead=mobdead})
|
||||
end
|
||||
end -- campaign_item
|
||||
|
||||
function cp_mob_dead (name, line, wildcards)
|
||||
Execute("cp check")
|
||||
end
|
||||
|
||||
function cp_time (name, line, wildcards)
|
||||
local text = wildcards [1]
|
||||
|
||||
-- work out when campaign ends
|
||||
|
||||
when_required = os.time ()
|
||||
|
||||
local days = string.match (text, "(%d+) days?")
|
||||
if days then
|
||||
when_required = when_required + tonumber (days) * 60 * 60 * 24
|
||||
end -- some days left
|
||||
|
||||
local hours = string.match (text, "(%d+) hours?")
|
||||
if hours then
|
||||
when_required = when_required + tonumber (hours) * 60 * 60
|
||||
end -- some days left
|
||||
|
||||
local minutes = string.match (text, "(%d+) minutes?")
|
||||
if minutes then
|
||||
when_required = when_required + tonumber (minutes) * 60
|
||||
end -- some days left
|
||||
|
||||
phelper:enabletriggroup("campaigncheck", false)
|
||||
phelper:enabletriggroup("campaignin", true)
|
||||
|
||||
if cp_info['mobs'] == nil or (type(cp_info['mobs']) == 'table' and not next(cp_info['mobs'])) then
|
||||
cp_info['mobs'] = copytable.shallow(mobsleft)
|
||||
SaveState()
|
||||
end
|
||||
var.mobs = serialize.save( "mobs", mobsleft )
|
||||
phelper:broadcast(1, var.mobs)
|
||||
build_time()
|
||||
if GetTimerInfo("cp_timer", 6) == false then
|
||||
check(EnableTimer("cp_timer", true))
|
||||
end
|
||||
|
||||
end -- cp_time
|
||||
|
||||
function campaign_done (name, line, wildcards)
|
||||
phelper:enabletriggroup("getnextline", true)
|
||||
end -- campaign_done
|
||||
|
||||
function nextline(name, line, wildcards)
|
||||
phelper:enabletriggroup("getnextline", false)
|
||||
if string.find(line, 'first campaign completed today') then
|
||||
local bonusqp = string.match(line, "^You receive (%d*) quest points bonus for your first campaign completed today.$")
|
||||
cp_info['bonusqp'] = bonusqp
|
||||
end
|
||||
cp_info['oncp'] = false
|
||||
var.cp_info = serialize.save( "cp_info", cp_info )
|
||||
SaveState()
|
||||
phelper:broadcast(3, var.cp_info)
|
||||
cp_none()
|
||||
end -- nextline
|
||||
|
||||
function campaign_fail (name, line, wildcards)
|
||||
cp_info.failed = 1
|
||||
cp_info['oncp'] = false
|
||||
var.cp_info = serialize.save( "cp_info", cp_info )
|
||||
SaveState()
|
||||
phelper:broadcast(4, var.cp_info)
|
||||
cp_none()
|
||||
end -- campaign_done
|
||||
|
||||
function campaign_reward (name, line, wildcards)
|
||||
local type = wildcards.type
|
||||
local amount = wildcards.amount
|
||||
cp_info[rewardtable[type]] = amount
|
||||
phelper:enabletriggroup("campaigndone", true)
|
||||
end
|
||||
|
||||
function campaign_complete(name, line, wildcards)
|
||||
phelper:enabletriggroup("campaignrew", true)
|
||||
cp_info['finishtime'] = GetInfo(304)
|
||||
cp_info['oncp'] = false
|
||||
end
|
||||
|
||||
function build_time()
|
||||
-- how long to go
|
||||
local time_to_go = when_required - os.time ()
|
||||
timer['secs'] = time_to_go
|
||||
timer['text'] = convert_time(time_to_go)
|
||||
local years, days, hours, mins, seconds = SecondsToDHMS(time_to_go)
|
||||
timer['days'] = days
|
||||
timer['hours'] = hours
|
||||
timer['mins'] = mins
|
||||
timer['cantake'] = cp_info['cantake']
|
||||
timer['shtime'] = cp_info['shtime']
|
||||
var.timer = serialize.save( "timer", timer )
|
||||
phelper:broadcast(2, var.timer)
|
||||
end
|
||||
|
||||
function update_timer()
|
||||
build_time()
|
||||
end
|
||||
|
||||
function mob_timer()
|
||||
for i,v in ipairs(mobsleft) do
|
||||
if v.mobdead == true then
|
||||
Execute("cp check")
|
||||
return
|
||||
end
|
||||
end
|
||||
if GetTimerInfo("mob_timer", 6) == true then
|
||||
check(EnableTimer("mob_timer", false))
|
||||
end
|
||||
end
|
||||
|
||||
function cp_check( name, line, wildcards)
|
||||
phelper:enabletriggroup("campaigncheck", true)
|
||||
mobsleft = {}
|
||||
timer = {}
|
||||
end -- cp_check
|
||||
|
||||
|
||||
function cp_new()
|
||||
cp_info = {}
|
||||
cp_info['mobs'] = {}
|
||||
cp_info['trains'] = 0
|
||||
cp_info['pracs'] = 0
|
||||
cp_info['gold'] = 0
|
||||
cp_info['tp'] = 0
|
||||
cp_info['qp'] = 0
|
||||
cp_info['bonusqp'] = 0
|
||||
cp_info['failed'] = 0
|
||||
cp_info['level'] = curlevel
|
||||
cp_info['starttime'] = GetInfo(304)
|
||||
cp_info['finishtime'] = 0
|
||||
cp_info['oncp'] = true
|
||||
cp_info['cantake'] = false
|
||||
cp_info['shtime'] = nil
|
||||
SaveState()
|
||||
phelper:broadcast(5)
|
||||
end
|
||||
|
||||
function cp_none( name, line, wildcards)
|
||||
cp_info['oncp'] = false
|
||||
phelper:enabletriggroup("campaigncheck", false)
|
||||
phelper:enabletriggroup("campaignin", false)
|
||||
phelper:enabletriggroup("campaignrew", false)
|
||||
phelper:enabletriggroup("campaigndone", false)
|
||||
check(EnableTimer("cp_timer", false))
|
||||
timer = {}
|
||||
end
|
||||
|
||||
function isoncp()
|
||||
if cp_info['oncp'] then
|
||||
return cp_info.level
|
||||
else
|
||||
return -1
|
||||
end
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
|
||||
if id == '3e7dedbe37e44942dd46d264' then
|
||||
if text:find("char") then
|
||||
res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval", "char")
|
||||
tt = assert (loadstring ('return ' .. gmcparg or ""))()
|
||||
|
||||
if tt['status'] then
|
||||
curlevel = tt.status.level
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
phelper:OnPluginBroadcast(msg, id, name, text)
|
||||
end
|
||||
|
||||
function OnPluginInstall ()
|
||||
--OnPluginEnable is automatically called by pluginhelper
|
||||
|
||||
assert (loadstring (GetVariable ("cp_info") or "")) ()
|
||||
|
||||
phelper:OnPluginInstall()
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginClose ()
|
||||
|
||||
phelper:OnPluginClose()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
ldplugin ("aard_GMCP_handler", "3e7dedbe37e44942dd46d264")
|
||||
|
||||
phelper:OnPluginEnable()
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
phelper:OnPluginDisable()
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
phelper:OnPluginConnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
|
||||
phelper:OnPluginDisconnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginSaveState ()
|
||||
var.cp_info = serialize.save( "cp_info", cp_info )
|
||||
|
||||
phelper:OnPluginSaveState()
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
phelper:set_default('cmd', 'bcp')
|
||||
phelper:set_default('plugin_colour', 'orange')
|
||||
|
||||
phelper:enable()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</muclient>
|
||||
|
@ -0,0 +1,236 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- $Id$ -->
|
||||
<muclient>
|
||||
<plugin
|
||||
name="xBroadcast_Double"
|
||||
author="Bast"
|
||||
id="aaafc15678afa22343c5a327"
|
||||
language="Lua"
|
||||
purpose="Sends updates when double is on"
|
||||
save_state="y"
|
||||
date_written="2009-08-02"
|
||||
requires="4.73"
|
||||
version="6.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
[FOR PLUGIN AUTHORS ONLY]
|
||||
|
||||
Detects when there is double
|
||||
|
||||
Example:
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "aaafc15678afa22343c5a327" then
|
||||
if msg == 1 then
|
||||
--get the timer info
|
||||
loadstring( text )()
|
||||
-- do something with timer
|
||||
end
|
||||
end -- playing status changed
|
||||
end
|
||||
|
||||
xBroadcast_Double : Broadcast 1
|
||||
timer = {}
|
||||
timer.text = "2 m"
|
||||
timer.secs = 90
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
<!-- Triggers -->
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^For the next (?<length>\d+) minutes experience is doubled in honor of the new superhero\.$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^For the next (?<length>\d+) minutes all experience is doubled!!$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^Double experience for (?<length>\d+) minutes courtesy of (.*).$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^\[[ ]*(?<length>\d+) minutes of double exp started courtesy (.*)\]$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^INFO: Double experience is running (.*) (?<length>\d+) minutes left.$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
script="doublestart"
|
||||
match="^Double exp will expire in roughly (?<length>\d+) minutes.$"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
regexp="y"
|
||||
script="doublefinish"
|
||||
match="^INFO: Bonus experience has now expired.$"
|
||||
sequence="100"
|
||||
group="doublestuff"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
regexp="y"
|
||||
script="doubletime"
|
||||
match="^INFO: (?<length>\d+) minutes* remaining of bonus experience.$"
|
||||
sequence="100"
|
||||
group="doublestuff"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
<!-- Timers -->
|
||||
<timers>
|
||||
<timer
|
||||
script="update_timer"
|
||||
enabled="n"
|
||||
second="30.00"
|
||||
name="doubletimer"
|
||||
>
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
internalrevision = "$Rev$"
|
||||
|
||||
dofile (GetPluginInfo (GetPluginID (), 20) .. "luapath.lua")
|
||||
|
||||
require "var"
|
||||
require "pluginhelper"
|
||||
require "verify"
|
||||
require 'ldplugin'
|
||||
require 'serialize'
|
||||
|
||||
doubleend = 0
|
||||
|
||||
function doublestart(name, line, wildcards)
|
||||
phelper:enabletriggroup('doublestuff', true)
|
||||
doubletime(name, line, wildcards)
|
||||
end
|
||||
|
||||
function broadcast_timer(left)
|
||||
local timer = {}
|
||||
timer['secs'] = left
|
||||
timer['text'] = convert_time(left)
|
||||
ttimer = serialize.save( "timer", timer )
|
||||
phelper:broadcast(1, ttimer, ttimer)
|
||||
end
|
||||
|
||||
function doubletime(name, line, wildcards)
|
||||
local doubleleft = tonumber (wildcards.length) * 60
|
||||
doubleend = os.time() + doubleleft
|
||||
ResetTimer("doubletimer")
|
||||
EnableTimer("doubletimer", true)
|
||||
broadcast_timer(doubleleft)
|
||||
end
|
||||
|
||||
function doublefinish(name, line, wildcards)
|
||||
doubleend = 0
|
||||
EnableTimer("doubletimer", false)
|
||||
phelper:enabletriggroup('doublestuff', false)
|
||||
broadcast_timer(0)
|
||||
end
|
||||
|
||||
function update_timer()
|
||||
left = doubleend - os.time()
|
||||
broadcast_timer(left)
|
||||
end
|
||||
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
|
||||
phelper:OnPluginBroadcast(msg, id, name, text)
|
||||
end
|
||||
|
||||
function OnPluginInstall ()
|
||||
--OnPluginEnable is automatically called by pluginhelper
|
||||
|
||||
phelper:OnPluginInstall()
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginClose ()
|
||||
|
||||
phelper:OnPluginClose()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
|
||||
phelper:OnPluginEnable()
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
phelper:OnPluginDisable()
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
phelper:OnPluginConnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
|
||||
phelper:OnPluginDisconnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginSaveState ()
|
||||
|
||||
phelper:OnPluginSaveState()
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
phelper:set_default('cmd', 'bdbl')
|
||||
phelper:set_default('plugin_colour', 'orange')
|
||||
|
||||
phelper:enable()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
@ -0,0 +1,775 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- $Id$ -->
|
||||
|
||||
<muclient>
|
||||
<plugin
|
||||
name="xBroadcast_Kills"
|
||||
author="Bast"
|
||||
id="aaa61c4570508448e19c7c14"
|
||||
language="Lua"
|
||||
purpose="broadcast when a mob is killed"
|
||||
save_state="y"
|
||||
date_written="2009-02-22 18:52:27"
|
||||
requires="4.73"
|
||||
version="6.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
[FOR PLUGIN AUTHORS ONLY]
|
||||
|
||||
Broadcasts when a mob is killed
|
||||
Example
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "aaa61c4570508448e19c7c14" and msg == 1 then
|
||||
local pvar = GetPluginVariable( "aaa61c4570508448e19c7c14", "kill_info")
|
||||
|
||||
-- get the mobs
|
||||
loadstring( pvar )()
|
||||
kill = kill_info
|
||||
end
|
||||
end
|
||||
|
||||
xBroadcast_Kills : Broadcast 1
|
||||
kill_info = {}
|
||||
kill_info.wielded_weapon = ""
|
||||
kill_info.totalxp = 90
|
||||
kill_info.second_weapon = ""
|
||||
kill_info.bcasted = false
|
||||
kill_info.blessingxp = 0
|
||||
kill_info.tp = 0
|
||||
kill_info.deathblow = 0
|
||||
kill_info.assassinate = 0
|
||||
kill_info.xp = 90
|
||||
kill_info.time = 1340386052
|
||||
kill_info.slit = 0
|
||||
kill_info.disintegrate = 0
|
||||
kill_info.level = 126
|
||||
kill_info.banishment = 0
|
||||
kill_info.gold = "3869"
|
||||
kill_info.vorpal = 0
|
||||
kill_info.room_id = 11390
|
||||
kill_info.name = "Grectza"
|
||||
kill_info.bonusxp = 0
|
||||
|
||||
]]>
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
<!-- Dodges
|
||||
A beaver dodges your attack.
|
||||
A beaver parries your attack.
|
||||
Courtnay d'Assini counter-strikes your attack!
|
||||
A giant lizard blinks out of existence avoiding your attack.
|
||||
Ayla's holy rift protects a human prisoner from your attack.
|
||||
A large bat fiddles with time and your attack is just a few seconds slow.
|
||||
A ghoulish creature blends in perfectly causing you to hit nothing but air.
|
||||
The solemn knight blocks your attack with his shield.
|
||||
The mine foreman avoids your attack, almost too easily.
|
||||
|
||||
You blink out of existence and avoid a small crow's attack.
|
||||
You dodge a beaver's attack.
|
||||
You misdirect a beaver's attack.
|
||||
You create a time shift and calmly step away from a beaver's attack.
|
||||
You get lucky and manage to escape a giant lizard's attack.
|
||||
Ayla's holy rift protects you from A mangled person's attack.
|
||||
You sense divine intervention as a Giant Shark's attack narrowly misses you.
|
||||
You parry ice devil's attack.
|
||||
You blend perfectly with your surroundings and avoid Valkur's lab guard's attack.
|
||||
-->
|
||||
<include name="constants.lua"/>
|
||||
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You (don't )?receive (\d+(?:\+\d+)*) experience points?\.$"
|
||||
regexp="y"
|
||||
name="mobxp"
|
||||
script="mobxp"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You (don't )?receive (\d+) bonus experience points? from your daily blessing\.$"
|
||||
name="blessingxp"
|
||||
script="bonusxp"
|
||||
regexp="y"
|
||||
sequence="99"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You (don't )?receive (\d+) bonus experience points *"
|
||||
name="bonusxp"
|
||||
script="bonusxp"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You (don't )?receive (\d+) 'rare kill' experience bonus."
|
||||
name="rarexp"
|
||||
script="bonusxp"
|
||||
sequence="100"
|
||||
regexp="y"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^That was a pointless no experience kill!$"
|
||||
regexp="y"
|
||||
name="mobxppointless"
|
||||
script="mobxp"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You switch targets and direct your attacks at (.*).\.$"
|
||||
regexp="y"
|
||||
name="mobswitch"
|
||||
script="mobswitch"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You flee from combat!$"
|
||||
regexp="y"
|
||||
name="mobnoneflee"
|
||||
script="mobnone"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You retreat from the combat!$"
|
||||
regexp="y"
|
||||
name="mobnoneretreat"
|
||||
script="mobnone"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^You get (.+) gold coins (.+) corpse of (.+)\.$"
|
||||
name="mobgold"
|
||||
script="mobgold"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^You get (.+) corpse of (.+)\.$"
|
||||
|
||||
name="mobname"
|
||||
script="mobname"
|
||||
sequence="101"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^Ayla gives you (.+) for the .+ corpse of (.+).$"
|
||||
name="saccorpse"
|
||||
script="mobname"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^(\w+) splits? (\d+) gold coins?. Your share is (\d+) gold\.$"
|
||||
name="splitgold"
|
||||
script="mobgold"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^You killed a Trivia bonus mob!! Trivia point added\.$"
|
||||
name="trivmob"
|
||||
script="trivmob"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^You killed a Triv bonus mob!! Triv point added\.$"
|
||||
name="trivmob2"
|
||||
script="trivmob"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^You killed a Trivia Point bonus mob!! Trivia point added\.$"
|
||||
name="trivmob3"
|
||||
script="trivmob"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^Deep magic stirs within your weapon. It seems to have a life of its own.$"
|
||||
name="vorpmob"
|
||||
script="vorpmob"
|
||||
other_back_colour="red"
|
||||
other_text_colour="black"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="^$"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
script="broadcast_kill"
|
||||
name="deadtrig"
|
||||
group="deadtrig"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
regexp="y"
|
||||
enabled="y"
|
||||
group="counter"
|
||||
match="^You assassinate (.*) with cold efficiency.$"
|
||||
send_to="12"
|
||||
sequence="990"
|
||||
other_back_colour="red"
|
||||
other_text_colour="black"
|
||||
script="assassinatemob"
|
||||
name="assassinate"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
group="counter"
|
||||
make_bold="y"
|
||||
match="^Your death blow CLEAVES (.*) in two!$"
|
||||
send_to="12"
|
||||
sequence="990"
|
||||
other_back_colour="red"
|
||||
other_text_colour="black"
|
||||
script="deathblowmob"
|
||||
name="deathblow"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
group="counter"
|
||||
make_bold="y"
|
||||
match="^You sneak behind (.*) and slit (.*) throat.$"
|
||||
send_to="12"
|
||||
sequence="990"
|
||||
other_back_colour="limegreen"
|
||||
other_text_colour="black"
|
||||
script="slitmob"
|
||||
name="slit"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
group="counter"
|
||||
make_bold="y"
|
||||
match="^You have disintegrated (.*)!$"
|
||||
send_to="12"
|
||||
sequence="990"
|
||||
other_back_colour="red"
|
||||
other_text_colour="black"
|
||||
script="disintegratemob"
|
||||
name="disintegrate"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
custom_colour="17"
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
group="counter"
|
||||
make_bold="y"
|
||||
match="^You look at (.*) very strangely.$"
|
||||
send_to="12"
|
||||
sequence="990"
|
||||
other_back_colour="blue"
|
||||
other_text_colour="green"
|
||||
script="banishmob"
|
||||
name="banish"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^\[(.*)\] Your (.*) \[(.*)\]$"
|
||||
name="damage"
|
||||
script="damage"
|
||||
sequence="100"
|
||||
regexp="y"
|
||||
omit_from_output="n"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^Your (.*) \[(.*)\]$"
|
||||
name="damage2"
|
||||
script="damage"
|
||||
sequence="100"
|
||||
regexp="y"
|
||||
omit_from_output="n"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^You spin around (.*), catching (.*) off guard, and execute a vicious double backstab.$"
|
||||
name="incombat"
|
||||
script="incombat"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="^(.*) is unaffected by your (.*)!$"
|
||||
name="immunity"
|
||||
script="immunity"
|
||||
regexp="y"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
internalrevision = "$Rev$"
|
||||
|
||||
dofile (GetPluginInfo (GetPluginID (), 20) .. "luapath.lua")
|
||||
|
||||
require "var"
|
||||
require "serialize"
|
||||
require "commas"
|
||||
require "pluginhelper"
|
||||
require "verify"
|
||||
require "ldplugin"
|
||||
require "eqdb"
|
||||
require "colours"
|
||||
require "aardutils"
|
||||
|
||||
db = EQdb:new{}
|
||||
|
||||
mobdamcache = {}
|
||||
|
||||
function damagedef()
|
||||
local tdamage = {}
|
||||
tdamage['hits'] = 0
|
||||
tdamage['misses'] = 0
|
||||
tdamage['damage'] = 0
|
||||
return tdamage
|
||||
end
|
||||
|
||||
function reset_kill()
|
||||
local room_id = kill_info.room_id
|
||||
kill_info = {}
|
||||
kill_info.tp = 0
|
||||
kill_info.vorpal = 0
|
||||
kill_info.assassinate = 0
|
||||
kill_info.deathblow = 0
|
||||
kill_info.slit = 0
|
||||
kill_info.disintegrate = 0
|
||||
kill_info.banishment = 0
|
||||
kill_info.xp = 0
|
||||
kill_info.rarexp = 0
|
||||
kill_info.bonusxp = 0
|
||||
kill_info.blessingxp = 0
|
||||
kill_info.totalxp = 0
|
||||
kill_info.noexp = 0
|
||||
kill_info.gold = 0
|
||||
kill_info.tp = 0
|
||||
kill_info.name = ""
|
||||
kill_info.wielded_weapon = ''
|
||||
kill_info.second_weapon = ''
|
||||
kill_info.bcasted = true
|
||||
kill_info.room_id = room_id
|
||||
kill_info.damage = {}
|
||||
kill_info.immunities = {}
|
||||
end
|
||||
|
||||
kill_info = {}
|
||||
reset_kill()
|
||||
var.cur_weapon = ''
|
||||
lastroom = -1
|
||||
|
||||
function reset_damage()
|
||||
kill_info['starttime'] = nil
|
||||
kill_info['finishtime'] = nil
|
||||
kill_info['damage'] = {}
|
||||
kill_info['immunities'] = {}
|
||||
end
|
||||
|
||||
function incombat(name, line, wildcards)
|
||||
if not kill_info.damage['backstab'] then
|
||||
kill_info.damage['backstab'] = damagedef()
|
||||
end
|
||||
kill_info.damage['backstab']['incombat'] = true
|
||||
end
|
||||
|
||||
function immunity(name, line, wildcards)
|
||||
local immunity = wildcards[2]
|
||||
if not kill_info.immunities[immunity] and kill_info.name == wildcards[1] then
|
||||
--print('setting immunity', immunity)
|
||||
kill_info.immunities[immunity] = true
|
||||
end
|
||||
end
|
||||
|
||||
function addtodamage(tdam, damtable)
|
||||
local damtype = tdam['damtype']
|
||||
if not damtype then
|
||||
damtype = 'Unknown'
|
||||
end
|
||||
if not damtable[damtype] then
|
||||
damtable[damtype] = damagedef()
|
||||
end
|
||||
|
||||
if tdam['damverb'] == 'misses' then
|
||||
damtable[damtype]['misses'] = damtable[damtype]['misses'] + tdam['hits']
|
||||
else
|
||||
damtable[damtype]['hits'] = damtable[damtype]['hits'] + tdam['hits']
|
||||
damtable[damtype]['damage'] = damtable[damtype]['damage'] + tdam['damage']
|
||||
end
|
||||
return damtable
|
||||
end
|
||||
|
||||
function damage(name, line, wildcards)
|
||||
|
||||
local tdam = parsedamageline(line)
|
||||
local damtype = tdam['damtype']
|
||||
|
||||
if not kill_info['starttime'] then
|
||||
kill_info['starttime'] = GetInfo(304)
|
||||
end
|
||||
if tdam['enemy'] and kill_info.name ~= '' and tdam['enemy'] ~= kill_info.name then
|
||||
if not mobdamcache[tdam['enemy']] then
|
||||
mobdamcache[tdam['enemy']] = {}
|
||||
end
|
||||
addtodamage(tdam, mobdamcache[tdam['enemy']])
|
||||
return
|
||||
end
|
||||
|
||||
if mobdamcache[tdam['enemy']] then
|
||||
kill_info.damage = mobdamcache[tdam['enemy']]
|
||||
mobdamcache[tdam['enemy']] = nil
|
||||
end
|
||||
addtodamage(tdam, kill_info.damage)
|
||||
end
|
||||
|
||||
function mobnone(name, line, wildcards)
|
||||
--print('setting name to none')
|
||||
kill_info.name = ""
|
||||
reset_damage()
|
||||
end
|
||||
|
||||
function mobname(name, line, wildcards)
|
||||
if kill_info.name == "" then
|
||||
kill_info.name = strip_colours(wildcards[2])
|
||||
end
|
||||
if name == 'saccorpse' then
|
||||
broadcast_kill()
|
||||
end
|
||||
end
|
||||
|
||||
function bonusxp(name, line, wildcards)
|
||||
if name == 'bonusxp' then
|
||||
kill_info.bonusxp = tonumber(wildcards[2])
|
||||
elseif name == 'blessingxp' then
|
||||
kill_info.blessingxp = tonumber(wildcards[2])
|
||||
elseif name == 'rarexp' then
|
||||
kill_info.rarexp = tonumber(wildcards[2])
|
||||
end
|
||||
end
|
||||
|
||||
function mobxp( name, line, wildcards )
|
||||
if name == 'mobxppointless' then
|
||||
wildcards[2] = '0'
|
||||
end
|
||||
if name == 'mobxp' or name == "mobxppointless" then
|
||||
kill_info.bonusxp = 0
|
||||
if string.find(wildcards[2], '+') then
|
||||
tlist = utils.split(wildcards[2], '+')
|
||||
local newxp = 0
|
||||
for i,v in ipairs(tlist) do
|
||||
newxp = newxp + tonumber(v)
|
||||
end
|
||||
kill_info.xp = newxp
|
||||
else
|
||||
kill_info.xp = tonumber(wildcards[2])
|
||||
end
|
||||
kill_info.time = GetInfo(304)
|
||||
kill_info.bcasted = false
|
||||
if string.find(line, "don't") then
|
||||
kill_info.noexp = 1
|
||||
end
|
||||
--DoAfterSpecial(.2, 'broadcast_kill()', 12)
|
||||
EnableTrigger ("deadtrig", true)
|
||||
-- enable deadtrig
|
||||
end
|
||||
end
|
||||
|
||||
function vorpmob( name, line, wildcards)
|
||||
kill_info.vorpal = 1
|
||||
kill_info.wielded_weapon = phelper.weaponsn
|
||||
kill_info.second_weapon = phelper.secondsn
|
||||
end
|
||||
|
||||
function mobswitch( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
reset_damage()
|
||||
end
|
||||
|
||||
function assassinatemob( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
kill_info.assassinate = 1
|
||||
end
|
||||
|
||||
function slitmob( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
kill_info.slit = 1
|
||||
kill_info.bcasted = false
|
||||
kill_info.time = GetInfo(304)
|
||||
broadcast_kill()
|
||||
end
|
||||
|
||||
function disintegratemob( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
kill_info.disintegrate = 1
|
||||
kill_info.bcasted = false
|
||||
kill_info.time = GetInfo(304)
|
||||
broadcast_kill()
|
||||
end
|
||||
|
||||
function banishmob( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
kill_info.banishment = 1
|
||||
kill_info.bcasted = false
|
||||
kill_info.time = GetInfo(304)
|
||||
broadcast_kill()
|
||||
end
|
||||
|
||||
function deathblowmob( name, line, wildcards)
|
||||
kill_info.name = strip_colours(wildcards[1])
|
||||
kill_info.deathblow = 1
|
||||
end
|
||||
|
||||
function mobgold( name, line, wildcards )
|
||||
if name == 'mobgold' then
|
||||
kill_info.gold = wildcards[1]
|
||||
if kill_info.name == "" then
|
||||
kill_info.name = strip_colours(wildcards[3])
|
||||
end
|
||||
elseif name == 'splitgold' then
|
||||
kill_info.gold = wildcards[2]
|
||||
end
|
||||
kill_info.gold = string.gsub(kill_info.gold, ",", "")
|
||||
end
|
||||
|
||||
function broadcast_kill()
|
||||
kill_info['finishtime'] = GetInfo(304)
|
||||
if kill_info.bcasted == false then
|
||||
if kill_info.name == nil then
|
||||
kill_info.name = 'did not get the mob name'
|
||||
end
|
||||
kill_info.totalxp = tonumber(kill_info.xp or 0) + tonumber(kill_info.rarexp or 0) + tonumber(kill_info.bonusxp or 0) + tonumber(kill_info.blessingxp or 0)
|
||||
var.kill_info = serialize.save( "kill_info", kill_info )
|
||||
phelper:broadcast(1, var.kill_info)
|
||||
--disable deadtrig
|
||||
end
|
||||
EnableTrigger ("deadtrig", false)
|
||||
phelper:processevent('mobdeath', kill_info)
|
||||
reset_kill()
|
||||
end
|
||||
|
||||
function trivmob( name, line, wildcards )
|
||||
kill_info.tp = 1
|
||||
end
|
||||
|
||||
function onwearlocchange(stuff)
|
||||
local stuff = assert (loadstring ('return ' .. stuff or ""))()
|
||||
--tprint(stuff)
|
||||
local wearloc = stuff.wearloc
|
||||
local action = stuff.action
|
||||
local sitem = stuff.item
|
||||
if wearloc ~= 'All' then
|
||||
local item = db:getitem(stuff.item.serial)
|
||||
--print('onwearlocchange')
|
||||
if tonumber(action) == 2 then
|
||||
if sitem.placestr == 'wielded' then
|
||||
phelper:set('weaponsn', item.serial, {silent=true})
|
||||
elseif sitem.placestr == 'second' then
|
||||
phelper:set('secondsn', item.serial, {silent=true})
|
||||
end
|
||||
elseif tonumber(action) == 1 then
|
||||
if sitem.placestr == 'wielded' then
|
||||
phelper:set('weaponsn', '', {silent=true})
|
||||
elseif sitem.placestr == 'second' then
|
||||
phelper:set('secondsn', '', {silent=true})
|
||||
end
|
||||
end
|
||||
elseif wearloc == 'All' then
|
||||
-- get wielded and second from db
|
||||
local witem = db:getitembywearslot(24)
|
||||
local sitem = db:getitembywearslot(25)
|
||||
if witem then
|
||||
phelper:set('weaponsn', witem.serial, {silent=true})
|
||||
end
|
||||
if sitem then
|
||||
phelper:set('secondsn', sitem.serial, {silent=true})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
instatriggers = {"assassinate", "deathblow", "slit", "disintegrate", "banish", "vorpmob"}
|
||||
|
||||
function oninstacolourchange(stuff)
|
||||
for i,v in ipairs(instatriggers) do
|
||||
SetTriggerOption(v, "other_back_colour", phelper.instaback)
|
||||
SetTriggerOption(v, "other_text_colour", phelper.instatext)
|
||||
end
|
||||
end
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
|
||||
if id == '3e7dedbe37e44942dd46d264' then
|
||||
if text:find("char.status") then
|
||||
res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval", "char")
|
||||
tt = assert (loadstring ('return ' .. gmcparg or ""))()
|
||||
|
||||
if tt['status'] then
|
||||
kill_info.level = tonumber(tt.status.level)
|
||||
if tt.status.enemy ~= "" and kill_info.name == "" then
|
||||
kill_info.name = strip_colours(tt.status.enemy)
|
||||
reset_damage()
|
||||
end
|
||||
end
|
||||
elseif text:find('room.info') then
|
||||
res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","room.info")
|
||||
tt = assert (loadstring ('return ' .. gmcparg or ""))()
|
||||
|
||||
kill_info.room_id = tonumber(tt.num)
|
||||
|
||||
if tonumber(tt.num) ~= lastroom and kill_info.name ~= "" then
|
||||
lastroom = tonumber(tt.num)
|
||||
kill_info.name = ""
|
||||
--print('resetting name to none')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
phelper:OnPluginBroadcast(msg, id, name, text)
|
||||
end
|
||||
|
||||
function OnPluginInstall ()
|
||||
--OnPluginEnable is automatically called by pluginhelper
|
||||
|
||||
phelper:OnPluginInstall()
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginClose ()
|
||||
|
||||
phelper:OnPluginClose()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
ldplugin("aard_GMCP_handler", "3e7dedbe37e44942dd46d264")
|
||||
ldplugin ('eqdb', 'aaa56faed92ffc6146964abc')
|
||||
|
||||
phelper:register_remote("aaa56faed92ffc6146964abc", "wearlocchange", "onwearlocchange")
|
||||
phelper:registerevent('option_instaback', phelper, oninstacolourchange)
|
||||
phelper:registerevent('option_instatext', phelper, oninstacolourchange)
|
||||
|
||||
phelper:OnPluginEnable()
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
phelper:OnPluginDisable()
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
phelper:OnPluginConnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
|
||||
phelper:OnPluginDisconnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginSaveState ()
|
||||
|
||||
phelper:OnPluginSaveState()
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
phelper:set_default('cmd', 'bkill')
|
||||
phelper:set_default('plugin_colour', 'orange')
|
||||
|
||||
phelper:add_setting('weaponsn', {help="the sn of the weapon that is currently wielded", type="string", default="", readonly=true})
|
||||
phelper:add_setting('secondsn', {help="the sn of the weapon that is currently seconded", type="string", default="", readonly=true})
|
||||
phelper:add_setting('instaback', {help="the background colour for an instakill spell/skill", type="colour", default="red"})
|
||||
phelper:add_setting('instatext', {help="the text colour for an instakill spell/skill", type="colour", default="black"})
|
||||
|
||||
phelper:enable()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
@ -0,0 +1,441 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- $Id$ -->
|
||||
<muclient>
|
||||
<plugin
|
||||
name="xBroadcast_Level"
|
||||
author="Bast"
|
||||
id="aaa0ab9ed92f8fc614664bd1"
|
||||
language="Lua"
|
||||
purpose="broadcast info from leveling"
|
||||
save_state="y"
|
||||
date_written="2009-02-22 14:20:07"
|
||||
requires="4.73"
|
||||
version="6.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
[FOR PLUGIN AUTHORS ONLY]
|
||||
|
||||
Broadcasts stats when leveling
|
||||
Example
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "aaa0ab9ed92f8fc614664bd1" and msg == 2 then
|
||||
local pvar = GetPluginVariable( "aaa0ab9ed92f8fc614664bd1", levelinfo )
|
||||
|
||||
-- get the info
|
||||
loadstring( pvar )()
|
||||
info = levelinfo
|
||||
end
|
||||
end
|
||||
|
||||
Broadcasts
|
||||
1 - level info, get var.levelinfo and loadstring it
|
||||
levelinfo = {}
|
||||
levelinfo.starttime = 1340385935
|
||||
levelinfo.hp = "30"
|
||||
levelinfo.mv = "31"
|
||||
levelinfo.luc = 0
|
||||
levelinfo.blessingtrains = 0
|
||||
levelinfo.pracs = "10"
|
||||
levelinfo.level = "126"
|
||||
levelinfo.str = 1
|
||||
levelinfo.con = 0
|
||||
levelinfo.totallevels = 1734
|
||||
levelinfo.bonustrains = 0
|
||||
levelinfo.mp = "25"
|
||||
levelinfo.int = 0
|
||||
levelinfo.type = "level"
|
||||
levelinfo.trains = "4"
|
||||
levelinfo.wis = 1
|
||||
levelinfo.dex = 0
|
||||
2 - Created
|
||||
3 - Heroed
|
||||
4 - SuperHeroed
|
||||
5 - Preremort
|
||||
6 - Remorted to Level 1
|
||||
7 - Pre-Tiered
|
||||
8 - Tiered
|
||||
|
||||
]]>
|
||||
</description>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Get our standard constants -->
|
||||
|
||||
|
||||
<include name="constants.lua"/>
|
||||
<triggers>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="Congratulations, hero. You have increased your powers!"
|
||||
name="pup"
|
||||
script="level"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="You gain a powerup."
|
||||
name="pupbless"
|
||||
script="level"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="You raise a level! You are now level *."
|
||||
name="level"
|
||||
script="level"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="You gain a level - you are now level *."
|
||||
name="levelbless"
|
||||
script="level"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You gain * hit points, * mana, * moves, * practices and * trains."
|
||||
name="levelgains"
|
||||
script="levelgains"
|
||||
group="linfo"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
regexp="y"
|
||||
match="^You gain (.*) extra trains? daily blessing bonus.$"
|
||||
name="blessingtrains"
|
||||
script="levbonus"
|
||||
group="linfo"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You gain * trains."
|
||||
name="pupgains"
|
||||
script="levelgains"
|
||||
group="linfo"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
regexp="y"
|
||||
match="^Lucky! You gain an extra (\d) training sessions?!$"
|
||||
name="bonustrains"
|
||||
script="levbonus"
|
||||
group="linfo"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="You gain a bonus * point!"
|
||||
name="bonusstat"
|
||||
script="levbonus"
|
||||
group="linfo"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="n"
|
||||
match="*"
|
||||
name="catchall"
|
||||
script="levbonus"
|
||||
group="linfo"
|
||||
sequence="101"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^ Congratulations %1, you have now completed character creation.$"
|
||||
name="created"
|
||||
script="created"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^Congratulations! You are now a superhero!$"
|
||||
name="superhero"
|
||||
script="superhero"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
regexp="y"
|
||||
match="^\* Remort transformation complete\!$"
|
||||
name="remort"
|
||||
script="remort"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="## You have already remorted the max number of times."
|
||||
name="tier"
|
||||
script="tier"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
<trigger
|
||||
enabled="y"
|
||||
match="You are now flagged as remorting."
|
||||
name="preremort"
|
||||
script="preremort"
|
||||
sequence="100"
|
||||
>
|
||||
</trigger>
|
||||
</triggers>
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
internalrevision = "$Rev$"
|
||||
|
||||
dofile (GetPluginInfo (GetPluginID (), 20) .. "luapath.lua")
|
||||
|
||||
require "var"
|
||||
require "serialize"
|
||||
require "commas"
|
||||
require "pluginhelper"
|
||||
require "verify"
|
||||
require "ldplugin"
|
||||
require "aardutils"
|
||||
|
||||
-- keys - type, time, newlevel, hp, mana, mov, trains, pracs, bonustrains, bonusstats = {}
|
||||
-- bonusstats subtable keys are the bonus stat names
|
||||
levelinfo = {}
|
||||
waitcreated = false
|
||||
lasttier = -1
|
||||
lastremort = -1
|
||||
|
||||
function tier(name, line, wildcards)
|
||||
phelper:broadcast('7')
|
||||
lasttier = tonumber(char.base.tier)
|
||||
lastredo = tonumber(char.base.redos)
|
||||
waittier = true
|
||||
end
|
||||
|
||||
function created( name, line, wildcards )
|
||||
waitcreated = true
|
||||
end
|
||||
|
||||
function superhero( name, line, wildcards )
|
||||
levelinfo.level = 201
|
||||
levelinfo.totallevels = getactuallevel(tonumber(levelinfo.level), char.base.remorts, char.base.tier, char.base.redos)
|
||||
phelper:broadcast(4)
|
||||
end
|
||||
|
||||
function preremort(name, line, wildcards)
|
||||
phelper:broadcast(5)
|
||||
end
|
||||
|
||||
function remort(name, line, wildcards)
|
||||
resetinfo()
|
||||
levelinfo.level = 1
|
||||
levelinfo.type = 'level'
|
||||
levelinfo.starttime = GetInfo(304)
|
||||
levelinfo.totallevels = getactuallevel(tonumber(levelinfo.level), char.base.remorts, char.base.tier, char.base.redos)
|
||||
var.levelinfo = serialize.save( "levelinfo", levelinfo )
|
||||
phelper:broadcast(6)
|
||||
end
|
||||
|
||||
function resetinfo()
|
||||
levelinfo = {}
|
||||
levelinfo.type = ""
|
||||
levelinfo.level = -1
|
||||
levelinfo.str = 0
|
||||
levelinfo.int = 0
|
||||
levelinfo.wis = 0
|
||||
levelinfo.dex = 0
|
||||
levelinfo.con = 0
|
||||
levelinfo.luc = 0
|
||||
levelinfo.starttime = -1
|
||||
levelinfo.hp = 0
|
||||
levelinfo.mp = 0
|
||||
levelinfo.mv = 0
|
||||
levelinfo.pracs = 0
|
||||
levelinfo.trains = 0
|
||||
levelinfo.bonustrains = 0
|
||||
levelinfo.blessingtrains = 0
|
||||
levelinfo.totallevels = 0
|
||||
end
|
||||
|
||||
function level ( name, line, wildcards )
|
||||
resetinfo()
|
||||
if name == 'levelbless' then
|
||||
name = 'level'
|
||||
end
|
||||
if name == 'pupbless' then
|
||||
name = 'pup'
|
||||
end
|
||||
if name == 'pup' then
|
||||
levelinfo.level = tonumber(char.status.level)
|
||||
end
|
||||
if superf then
|
||||
levelinfo.level = 201
|
||||
superf = false
|
||||
end
|
||||
levelinfo.type = name
|
||||
if levelinfo.type == "level" then
|
||||
levelinfo.level = wildcards[1]
|
||||
if tonumber(levelinfo.level) == 200 then
|
||||
phelper:broadcast(3)
|
||||
end
|
||||
if tonumber(levelinfo.level) == 201 then
|
||||
phelper:broadcast(4)
|
||||
end
|
||||
end
|
||||
levelinfo.totallevels = getactuallevel(tonumber(levelinfo.level), char.base.remorts, char.base.tier, char.base.redos)
|
||||
levelinfo.starttime = GetInfo(304)
|
||||
phelper:enabletriggroup( "linfo", true )
|
||||
end
|
||||
|
||||
function levelgains (name, line, wildcards)
|
||||
if name == "pupgains" then
|
||||
levelinfo.trains = wildcards[1]
|
||||
elseif name == "levelgains" then
|
||||
levelinfo.hp = wildcards[1]
|
||||
levelinfo.mp = wildcards[2]
|
||||
levelinfo.mv = wildcards[3]
|
||||
levelinfo.pracs = wildcards[4]
|
||||
levelinfo.trains = wildcards[5]
|
||||
end
|
||||
end
|
||||
|
||||
function levbonus (name, line, wildcards)
|
||||
if name == "bonustrains" then
|
||||
levelinfo.bonustrains = wildcards[1]
|
||||
elseif name == 'blessingtrains' then
|
||||
levelinfo.blessingtrains = tonumber(wildcards[1])
|
||||
elseif name == "bonusstat" then
|
||||
levelinfo[string.lower(string.sub(wildcards[1], 1, 3))] = 1
|
||||
elseif name == "catchall" and trim(line) == "" and tonumber(levelinfo.trains) > 0 then
|
||||
phelper:enabletriggroup( "linfo", false )
|
||||
var.levelinfo = serialize.save( "levelinfo", levelinfo )
|
||||
phelper:broadcast(1, var.levelinfo)
|
||||
end
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == '3e7dedbe37e44942dd46d264' then
|
||||
if text:find("char") then
|
||||
res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char")
|
||||
char = assert (loadstring ('return ' .. gmcparg or ""))()
|
||||
if waittier and tonumber(char.status.state) == 2 then
|
||||
sawstate2 = true
|
||||
end
|
||||
if char.status then
|
||||
state = char.status.state
|
||||
statestring = statestrings[tonumber(state)]
|
||||
if statestring == 'active' and waitcreated then
|
||||
waitcreated = false
|
||||
phelper:broadcast(2)
|
||||
end
|
||||
if statestring == 'active' and waittier and sawstate2 and
|
||||
(tonumber(char.base.tier) == lasttier + 1 or (tonumber(char.base.tier) == lasttier and tonumber(char.base.redos) == lastredo + 1)) and
|
||||
tonumber(char.base.remorts) == 1 then
|
||||
waittier = false
|
||||
sawstate2 = false
|
||||
lasttier = -1
|
||||
lastremort = -1
|
||||
resetinfo()
|
||||
levelinfo.level = 1
|
||||
levelinfo.type = 'level'
|
||||
levelinfo.starttime = GetInfo(304)
|
||||
levelinfo.totallevels = getactuallevel(tonumber(1), char.base.remorts, char.base.tier, char.base.redos)
|
||||
var.levelinfo = serialize.save( "levelinfo", levelinfo )
|
||||
phelper:broadcast(8)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
phelper:OnPluginBroadcast(msg, id, name, text)
|
||||
end
|
||||
|
||||
function OnPluginInstall ()
|
||||
--OnPluginEnable is automatically called by pluginhelper
|
||||
|
||||
assert (loadstring (GetVariable ("levelinfo") or "")) ()
|
||||
|
||||
phelper:OnPluginInstall()
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginClose ()
|
||||
|
||||
phelper:OnPluginClose()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
phelper:OnPluginEnable()
|
||||
|
||||
ldplugin ("aard_GMCP_handler", "3e7dedbe37e44942dd46d264")
|
||||
|
||||
if IsConnected () then
|
||||
CallPlugin("3e7dedbe37e44942dd46d264","Send_GMCP_Packet","request char")
|
||||
end -- if already connected
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
phelper:OnPluginDisable()
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
phelper:OnPluginConnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
|
||||
phelper:OnPluginDisconnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginSaveState ()
|
||||
|
||||
phelper:OnPluginSaveState()
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
function OnPluginCommand (stext)
|
||||
stext = trim(stext)
|
||||
if stext == 'superhero loud' or stext == 'superhero silent' or stext == 'superhero confirm' then
|
||||
local wildcards = {}
|
||||
wildcards.newlevel = 201
|
||||
level ( 'level', 'You raise a level! You are now level 201.', wildcards )
|
||||
end
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
phelper:set_default('cmd', 'blev')
|
||||
phelper:set_default('plugin_colour', 'orange')
|
||||
|
||||
phelper:enable()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
@ -0,0 +1,363 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE muclient>
|
||||
<!-- $Id$ -->
|
||||
<muclient>
|
||||
<plugin
|
||||
name="xBroadcast_Quest"
|
||||
author="Bast"
|
||||
id="aaa8a9eda20fa11787c6b438"
|
||||
language="Lua"
|
||||
purpose="Broadcast whenever anything happens with a quest"
|
||||
save_state="y"
|
||||
date_written="2009-02-20 12:31:01"
|
||||
requires="4.73"
|
||||
version="6.1"
|
||||
>
|
||||
|
||||
<description trim="y">
|
||||
<![CDATA[
|
||||
[FOR PLUGIN AUTHORS ONLY]
|
||||
|
||||
Broadcasts when anything happens in a quest
|
||||
Broadcasts
|
||||
1 - can now quest
|
||||
2 - Mob info : get var.quest_info and loadstring it
|
||||
see below
|
||||
3 - time left to finish quest
|
||||
timer = {secs = num, text = 'time in text format' }
|
||||
4 - quest mob killed
|
||||
6 - rewards and time : get var.quest_info and loadstring it, values will be 0 if not applicable
|
||||
see below
|
||||
7 - time left until next quest
|
||||
timer = {secs = num, text = 'time in text format' }
|
||||
8 - failed the quest
|
||||
|
||||
Example:
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
if id == "aaa8a9eda20fa11787c6b438" and msg == 2 then
|
||||
local pvar = GetPluginVariable( "aaa8a9eda20fa11787c6b438" , "quest_info")
|
||||
|
||||
--get the mob info
|
||||
loadstring( pvar )()
|
||||
quest_stuff = quest_info
|
||||
end
|
||||
end
|
||||
|
||||
Broadcast 2
|
||||
quest_info = {}
|
||||
quest_info.starttime = 1340386244
|
||||
quest_info.mobname = "a mountain lion"
|
||||
quest_info.finishtime = -1
|
||||
quest_info.lucky = 0
|
||||
quest_info.tier = 0
|
||||
quest_info.mccp = 0
|
||||
quest_info.pracs = 0
|
||||
quest_info.tp = 0
|
||||
quest_info.totqp = 0
|
||||
quest_info.double = 0
|
||||
quest_info.failed = 0
|
||||
quest_info.daily = 0
|
||||
quest_info.gold = 0
|
||||
quest_info.mobarea = "The Broken Halls of Horath"
|
||||
quest_info.trains = 0
|
||||
quest_info.qp = 0
|
||||
quest_info.mobroom = "Nearing the Palace"
|
||||
|
||||
xBroadcast_Quest : Broadcast 3
|
||||
timer = {}
|
||||
timer.text = "44 m"
|
||||
timer.secs = 2640
|
||||
|
||||
Broadcast 6
|
||||
quest_info = {}
|
||||
quest_info.starttime = 1340386244
|
||||
quest_info.mobname = "a mountain lion"
|
||||
quest_info.finishtime = 1340386313
|
||||
quest_info.lucky = "0"
|
||||
quest_info.tier = "1"
|
||||
quest_info.mccp = "2"
|
||||
quest_info.pracs = "0"
|
||||
quest_info.tp = "0"
|
||||
quest_info.totqp = 19
|
||||
quest_info.double = 0
|
||||
quest_info.failed = 0
|
||||
quest_info.daily = 0
|
||||
quest_info.gold = "4294"
|
||||
quest_info.mobarea = "The Broken Halls of Horath"
|
||||
quest_info.trains = "0"
|
||||
quest_info.qp = "16"
|
||||
quest_info.mobroom = "Nearing the Palace"
|
||||
|
||||
xBroadcast_Quest : Broadcast 7
|
||||
timer = {}
|
||||
timer.text = "28 m"
|
||||
timer.secs = 1707
|
||||
|
||||
]]>
|
||||
</description>
|
||||
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Triggers -->
|
||||
|
||||
<triggers>
|
||||
|
||||
</triggers>
|
||||
|
||||
<!-- Timers -->
|
||||
|
||||
|
||||
<timers>
|
||||
<timer
|
||||
script="update_timer"
|
||||
enabled="y"
|
||||
second="30.00"
|
||||
name="questtimer"
|
||||
>
|
||||
</timer>
|
||||
</timers>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
internalrevision = "$Rev$"
|
||||
|
||||
dofile (GetPluginInfo (GetPluginID (), 20) .. "luapath.lua")
|
||||
|
||||
require "var"
|
||||
require "serialize"
|
||||
require "commas"
|
||||
require 'pluginhelper'
|
||||
require "verify"
|
||||
require "ldplugin"
|
||||
|
||||
onquest = false
|
||||
timer ={}
|
||||
|
||||
function blankquest ()
|
||||
local quest_info = {}
|
||||
quest_info.finishtime = -1
|
||||
quest_info.starttime = -1
|
||||
quest_info.mobname = ''
|
||||
quest_info.mobarea = ''
|
||||
quest_info.mobroom = ''
|
||||
quest_info.totqp = 0
|
||||
quest_info.daily = 0
|
||||
quest_info.double = 0
|
||||
quest_info.qp = 0
|
||||
quest_info.gold = 0
|
||||
quest_info.tier = 0
|
||||
quest_info.mccp = 0
|
||||
quest_info.lucky = 0
|
||||
quest_info.tp = 0
|
||||
quest_info.trains = 0
|
||||
quest_info.pracs = 0
|
||||
quest_info.failed = 0
|
||||
return quest_info
|
||||
end
|
||||
|
||||
function quest_available (name, line, wildcards)
|
||||
check(EnableTimer("questtimer", false))
|
||||
phelper:broadcast(1)
|
||||
end -- quest_available
|
||||
|
||||
function quest_time_to_go (name, line, wildcards)
|
||||
local mins = tonumber (wildcards [1])
|
||||
if mins then
|
||||
when_required = os.time () + mins * 60
|
||||
end -- if
|
||||
update_timer()
|
||||
end -- quest_time_to_go
|
||||
|
||||
function questor_time (minutes)
|
||||
|
||||
when_required = os.time () + tonumber (minutes) * 60
|
||||
|
||||
onquest = true
|
||||
update_timer()
|
||||
|
||||
end -- questor_end
|
||||
|
||||
function update_timer()
|
||||
-- how long to go
|
||||
if when_required == nil then
|
||||
return
|
||||
end
|
||||
check(EnableTimer("questtimer", true))
|
||||
local time_to_go = when_required - os.time ()
|
||||
timer['secs'] = time_to_go
|
||||
timer['text'] = convert_time(time_to_go)
|
||||
var.timer = serialize.save( "timer", timer )
|
||||
if onquest then
|
||||
phelper:broadcast(3, var.timer)
|
||||
else
|
||||
phelper:broadcast(7, var.timer)
|
||||
end
|
||||
end
|
||||
|
||||
function formatquest()
|
||||
if not next(phelper.tquest) then
|
||||
return "None"
|
||||
else
|
||||
local ttable = {}
|
||||
for i,v in pairs(phelper.tquest) do
|
||||
tstring = tostring(i) .. " : " .. tostring(v)
|
||||
table.insert(ttable, tstring)
|
||||
end
|
||||
return table.concat (ttable, "\n")
|
||||
end
|
||||
end
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
function OnPluginBroadcast (msg, id, name, text)
|
||||
phelper:OnPluginBroadcast(msg, id, name, text)
|
||||
if id == '3e7dedbe37e44942dd46d264' then
|
||||
if text:find("comm.quest") then
|
||||
res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","comm.quest")
|
||||
stuff = assert (loadstring ('return ' .. gmcparg or ""))()
|
||||
|
||||
if stuff.action == 'ready' then
|
||||
phelper:broadcast(1)
|
||||
check(EnableTimer("questtimer", false))
|
||||
elseif stuff.action == 'start' then
|
||||
phelper.tquest = blankquest()
|
||||
phelper.tquest['starttime'] = GetInfo(304)
|
||||
phelper.tquest['mobname'] = stuff.targ
|
||||
phelper.tquest['mobroom'] = stuff.room
|
||||
phelper.tquest['mobarea'] = stuff.area
|
||||
var.quest_info = serialize.save( "quest_info", phelper.tquest )
|
||||
phelper:broadcast(2, var.quest_info)
|
||||
questor_time (tonumber(stuff.timer))
|
||||
SaveState()
|
||||
elseif stuff.action == 'killed' then
|
||||
check(EnableTimer("questtimer", false))
|
||||
phelper:broadcast(4)
|
||||
elseif stuff.action == 'comp' then
|
||||
phelper.tquest['qp'] = stuff.qp
|
||||
phelper.tquest['gold'] = stuff.gold
|
||||
phelper.tquest['tier'] = stuff.tierqp
|
||||
phelper.tquest['lucky'] = stuff.lucky
|
||||
phelper.tquest['mccp'] = stuff.mccp
|
||||
phelper.tquest['tp'] = stuff.tp
|
||||
phelper.tquest['trains'] = stuff.trains
|
||||
phelper.tquest['pracs'] = stuff.pracs
|
||||
phelper.tquest['finishtime'] = GetInfo(304)
|
||||
phelper.tquest['double'] = 0
|
||||
phelper.tquest['daily'] = 0
|
||||
phelper.tquest['totqp'] = tonumber(stuff.totqp)
|
||||
if tonumber(stuff.double) == 1 then
|
||||
phelper.tquest['double'] = 1
|
||||
end
|
||||
if tonumber(stuff.daily) == 1 then
|
||||
phelper.tquest['daily'] = 1
|
||||
end
|
||||
var.quest_info = serialize.save( "quest_info", phelper.tquest )
|
||||
phelper:broadcast(6, var.quest_info)
|
||||
when_required = os.time () + (30 * 60) -- 30 mins to go
|
||||
onquest = false
|
||||
update_timer()
|
||||
SaveState()
|
||||
elseif stuff.action == 'fail' or stuff.action == 'timeout' then
|
||||
when_required = os.time () + (stuff.wait * 60) -- 15 mins to go
|
||||
onquest = false
|
||||
update_timer()
|
||||
phelper.tquest.failed = 1
|
||||
phelper.tquest['finishtime'] = GetInfo(304)
|
||||
var.quest_info = serialize.save( "quest_info", phelper.tquest )
|
||||
phelper:broadcast(8, var.quest_info)
|
||||
SaveState()
|
||||
elseif stuff.action == 'status' then
|
||||
if stuff.status == 'ready' then
|
||||
quest_available()
|
||||
elseif stuff.wait then
|
||||
when_required = os.time() + (stuff.wait * 60)
|
||||
update_timer()
|
||||
elseif stuff.target == 'killed' then
|
||||
phelper:broadcast(4)
|
||||
elseif stuff.target == 'missing' then
|
||||
|
||||
else
|
||||
onquest = true
|
||||
phelper.tquest['starttime'] = GetInfo(304)
|
||||
phelper.tquest['mobname'] = stuff.targ
|
||||
phelper.tquest['mobroom'] = stuff.room
|
||||
phelper.tquest['mobarea'] = stuff.area
|
||||
var.quest_info = serialize.save( "quest_info", phelper.tquest )
|
||||
phelper:broadcast(2, var.quest_info)
|
||||
questor_time (tonumber(stuff.timer))
|
||||
SaveState()
|
||||
end
|
||||
elseif stuff.action == 'reset' then
|
||||
when_required = os.time() + (stuff.timer * 60)
|
||||
update_timer()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function OnPluginInstall ()
|
||||
--OnPluginEnable is automatically called by pluginhelper
|
||||
|
||||
phelper:OnPluginInstall()
|
||||
end -- OnPluginInstall
|
||||
|
||||
function OnPluginClose ()
|
||||
|
||||
phelper:OnPluginClose()
|
||||
end -- OnPluginClose
|
||||
|
||||
function OnPluginEnable ()
|
||||
ldplugin ("aard_GMCP_handler", "3e7dedbe37e44942dd46d264")
|
||||
|
||||
phelper:OnPluginEnable()
|
||||
|
||||
if IsConnected() then
|
||||
CallPlugin("3e7dedbe37e44942dd46d264","Send_GMCP_Packet","request quest")
|
||||
end
|
||||
|
||||
end -- OnPluginEnable
|
||||
|
||||
function OnPluginDisable ()
|
||||
|
||||
phelper:OnPluginDisable()
|
||||
end -- OnPluginDisable
|
||||
|
||||
function OnPluginConnect ()
|
||||
|
||||
phelper:OnPluginConnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginDisconnect ()
|
||||
|
||||
phelper:OnPluginDisconnect()
|
||||
end -- function OnPluginConnect
|
||||
|
||||
function OnPluginSaveState ()
|
||||
|
||||
phelper:OnPluginSaveState()
|
||||
end -- function OnPluginSaveState
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
phelper:set_default('cmd', 'bqu')
|
||||
phelper:set_default('plugin_colour', 'orange')
|
||||
|
||||
phelper:add_setting('tquest', {type="table", help="the current/last quest", default=serialize.save_simple(blankquest()), sortlev=35, istable=true, formatfunc=formatquest, readonly=true})
|
||||
|
||||
phelper:enable()
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</muclient>
|
Loading…
Reference in new issue