Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --master toggle
- local msTog=false
- local plyr=UnitName('player')
- local bheight=-100
- local faction=UnitFactionGroup('player')
- local train_state='off'
- -- character init
- local dev_mode=false -- will reset player stats every /reload if 'true'
- local btn_sz=30
- local btn_szx=34
- local btn_szy=50
- local hh=UnitSex('player')
- local hisher={'their', 'his', 'her'}
- local hb_wid=139
- local tW=900
- local tH=200
- local accepting_combat=true
- local able_combat=true
- local cooldown=false
- local function tbar(x) end
- local function trainTggl() end
- local colors={
- Strength={r=1, g=.2, b=.2},
- Charisma={r=1, g=1, b=.2},
- Wisdom={r=.6, g=.6, b=.2},
- Dexterity={r=.6, g=1, b=.4},
- Intelligence={r=.8, g=.3, b=1},
- reset={r=.1, g=1, b=.7},
- white={r=1, g=1, b=1},
- black={r=0, g=0, b=0},
- warn={r=1, g=.7, b=.2}
- }
- local hand='Interface\\CURSOR\\openhand'
- local point='Interface\\CURSOR\\Point'
- local ping='Sound\\Interface\\PickUp\\PutDownRing.ogg'
- local d20='Sound\\DOODAD\\FX_BoardTilesDice_04.OGG'
- local wound={
- '',
- 'Sound\\character\\Human\\Male\\HumanMaleWoundB.ogg',
- 'Sound\\character\\DraeneiFemalePC\\DraeneiFemalePCWoundG.ogg'
- }
- local function rcol(x)
- return math.random(x, 10)/10
- end
- local pending={}
- local cathedral={.499, .453}
- local spirits={.327, .648}
- local the_log=''
- local optArr={}
- optArr[1]={'',{1,1,1}}
- optArr[2]={'',{1,1,1}}
- optArr[3]={'',{1,1,1}}
- optArr[4]={'',{1,1,1}}
- local function prnt(x, col)
- -- local col={rcol(1),rcol(1),rcol(1)}
- -- print(col.r, col.g)
- if col==nil then col=colors.white end
- local opt=#optArr
- local insert={x, col}
- table.insert(optArr, 1, insert)
- -- print(optArr[1][1],optArr[1][2])
- table.remove(optArr, opt+1)
- -- the_log=optArr[4]..'\n'..optArr[3]..'\n'..optArr[2]..'\n'..optArr[1]..'\n'
- for k,v in pairs(optArr) do
- textFr.txt[k]:SetText(optArr[k][1])
- textFr.txt[k]:SetTextColor(optArr[k][2].r,optArr[k][2].g,optArr[k][2].b)
- end
- end
- local function dist(a, b)
- local c;
- local x, y=GetPlayerMapPosition("player");
- if x~=nil and y~=nil then
- c=math.sqrt(((a-x)*(a-x))+((b-y)*(b-y)));
- else c=99999
- end
- return c
- end
- local GHFlashFrame
- local flashAnims, isAni
- -- ** color is {r=1,g=1,b=1 **}
- local ffrm = function(fadeIn, fadeOut, duration, color, alpha, texture, blend, repeating)
- local blendTypes = {"ADD","BLEND","MOD","ALPHAKEY","DISABLE"}
- if alpha == 1 then alpha = 0.99 end
- if not (color) and not (texture) then
- print("You must define a texture or color.")
- return
- end
- local delay = duration - (fadeIn + fadeOut)
- if repeating == nil then
- repeating = 1
- end
- if not (GHFlashFrame) then
- GHFlashFrame = CreateFrame("Frame", "GHFlashFrame", UIParent);
- GHFlashFrame:SetFrameStrata("BACKGROUND");
- GHFlashFrame:SetAllPoints(UIParent);
- GHFlashFrame.bg = GHFlashFrame:CreateTexture(nil, "CENTER")
- GHFlashFrame.bg:SetAllPoints(GHFlashFrame)
- end
- if not (flashAnims) then
- flashAnims = GHFlashFrame:CreateAnimationGroup("Flashing")
- flashAnims.fadingIn = flashAnims:CreateAnimation("Alpha")
- flashAnims.fadingIn:SetOrder(1)
- flashAnims.fadingIn:SetSmoothing("NONE")
- flashAnims.fadingIn:SetToAlpha(1)
- flashAnims.fadingOut = flashAnims:CreateAnimation("Alpha")
- flashAnims.fadingOut:SetOrder(2)
- flashAnims.fadingOut:SetSmoothing("NONE")
- flashAnims.fadingOut:SetFromAlpha(1)
- flashAnims:SetScript("OnFinished",function(self,requested)
- GHFlashFrame:Hide()
- GHFlashFrame.bg:SetBlendMode("DISABLE")
- isAni = false
- end)
- flashAnims:SetScript("OnPlay",function(self)
- GHFlashFrame:Show()
- GHFlashFrame:SetAlpha(0)
- isAni = true
- end)
- end
- flashAnims.fadingIn:SetDuration(fadeIn)
- flashAnims.fadingIn:SetEndDelay(delay)
- flashAnims.fadingOut:SetDuration(fadeOut)
- if repeating > 1 then
- flashAnims:SetLooping("REPEAT")
- else
- flashAnims:SetLooping("NONE")
- end
- local timestart = GetTime()
- local looptime = duration * repeating
- flashAnims:SetScript("OnLoop", function(self, loopstate)
- if loopstate == "FORWARD" then
- local curtime = GetTime()
- if difftime(curtime, timestart) == looptime - duration then
- flashAnims:SetLooping("NONE")
- end
- end
- end)
- if texture then
- GHFlashFrame.bg:SetTexture(texture)
- GHFlashFrame.bg:SetBlendMode(blend or "ADD")
- GHFlashFrame.bg:SetAlpha(alpha or 1)
- flashAnims.fadingIn:SetToAlpha(alpha or 1)
- flashAnims.fadingOut:SetFromAlpha(alpha or 1)
- if color then
- GHFlashFrame.bg:SetVertexColor(
- color.r or color[1],
- color.g or color[2],
- color.b or color[3]
- )
- else
- GHFlashFrame.bg:SetVertexColor(1,1,1,1)
- end
- else
- if not (blend) then
- blend = 5
- end
- GHFlashFrame.bg:SetColorTexture(color.r or color[1], color.g or color[2], color.b or color[3])
- GHFlashFrame.bg:SetBlendMode(blendTypes[blend])
- GHFlashFrame.bg:SetAlpha(alpha or 1)
- end
- if isAni == true then -- if sone is already animating, stop it and do the new one
- GHFlashFrame:StopAnimating()
- GHFlashFrame.bg:SetAlpha(0)
- flashAnims.fadingIn:SetToAlpha(alpha or 1)
- flashAnims.fadingOut:SetFromAlpha(alpha or 1)
- flashAnims:Play()
- else -- otherwise animate
- flashAnims.fadingIn:SetToAlpha(alpha or 1)
- flashAnims.fadingOut:SetFromAlpha(alpha or 1)
- flashAnims:Play()
- end
- end
- -- if self, Tyler Durden
- local function RlPl_roll(cat, pos, opp)
- local dst_ck=false
- if UnitIsPlayer(opp) then
- dst_ck=CheckInteractDistance(opp, 3)
- else
- dst_ck=CheckInteractDistance('target', 3)
- end
- if dst_ck==true then
- cooldown=true
- C_Timer.After(5, function() cooldown=false end)
- local id,name=GetChannelName('xtensionxtooltip2')
- local roll=math.random(1,20)+Rllply[cat]
- if pos=='atk' then
- prnt('You attack '..opp..': '..roll, colors.white)
- pending[opp]=roll
- end
- if pos=='dfd' then
- prnt('You roll: '..roll..' in defense against '..opp, colors.white)
- end
- SendChatMessage('RlPl '..cat..' '..pos..' '..opp..' '..roll, 'CHANNEL', nil, id)
- else
- prnt('Too far!', colors.Strength)
- end
- end
- local rlpl_stats={
- str=1,
- int=1,
- chr=1,
- wis=1,
- dex=1,
- health=10,
- train=10
- }
- local cats={
- str='Strength',
- int='Intelligence',
- chr='Charisma',
- wis='Wisdom',
- dex='Dexterity'
- }
- local mPane=CreateFrame("Frame", nil, UIParent)
- mPane:SetSize(40, 40)
- mPane:SetPoint('TOP', UIParent, 'TOP')
- mPane:RegisterEvent('ADDON_LOADED')
- mPane:RegisterEvent('PLAYER_LOGOUT')
- -- mPane:SetMovable(true)
- -- mPane:EnableMouse(true)
- -- mPane:RegisterForDrag("LeftButton")
- -- mPane:SetScript("OnDragStart", mPane.StartMoving)
- -- mPane:SetScript("OnDragStop", mPane.StopMovingOrSizing)
- -- mPane:SetScript("OnEnter", function() SetCursor(hand) end)
- -- mPane:SetScript("OnLeave", function() SetCursor(point) end)
- mPane.tggl=CreateFrame("Button", nil, mPane, "SecureHandlerClickTemplate" )
- mPane.tggl:SetSize(30, 30)
- mPane.tggl:SetPoint("TOP", mPane, "TOP", 0, -30)
- mPane.tggl:RegisterForClicks("AnyUp")
- mPane.tggl:SetNormalTexture("Interface\\BUTTONS\\UI-GroupLoot-Dice-Up")
- mPane.tggl:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Dice-Up")
- mPane.tggl:SetHighlightTexture("Interface\\BUTTONS\\GLOWSTAR")
- mPane.tggl:SetMovable(true)
- mPane.tggl:EnableMouse(true)
- mPane.tggl:RegisterForDrag("LeftButton")
- mPane.tggl:SetScript("OnDragStart", mPane.StartMoving)
- mPane.tggl:SetScript("OnDragStop", mPane.StopMovingOrSizing)
- mPane.bg=mPane:CreateTexture()
- mPane.bg:SetTexture('Interface\\UNITPOWERBARALT\\MetalBronze_Circular_Frame')
- mPane.bg:SetSize(55, 55)
- mPane.bg:SetPoint('CENTER', mPane.tggl, 'CENTER', 0, 5)
- local UIShow=CreateFrame("Frame", nil, mPane)
- UIShow:SetSize(tW, tH)
- UIShow:SetPoint('TOP', mPane.tggl, 'TOP', 0, -10)
- local backdrop = {
- bgFile = "Interface\\GLUES\\Models\\UI_MainMenu_Pandaria\\VEB_Cloud_static_01",
- insets = {
- left = 11,
- right = 12,
- top = 12,
- bottom = 11
- }
- }
- UIShow:SetBackdrop(backdrop)
- UIShow:SetBackdropColor(1, 1, 1, .8)
- UIShow:Hide()
- local incFrRply=CreateFrame("Frame", nil, UIShow)
- local function RlPl_layout()
- textFr = CreateFrame("Frame",nil,UIShow)
- textFr:SetSize((tW/2)+40,150)
- textFr:SetPoint("LEFT",UIShow,"CENTER",-40,30)
- textFr.bg=textFr:CreateTexture()
- textFr.bg:SetTexture('Interface\\GLUES\\Models\\UI_Worgen\\gradient5Circle')
- textFr.bg:SetSize(700, 300)
- textFr.bg:SetPoint('LEFT', UIShow, 'CENTER', -150, 0)
- textFr.bg:SetVertexColor(1, 1, 1, .7)
- textFr.txt={}
- for k,v in pairs(optArr) do
- textFr.txt[k] = textFr:CreateFontString()
- textFr.txt[k]:SetPoint("BOTTOMLEFT",textFr,"BOTTOMLEFT",0,20*k)
- textFr.txt[k]:SetFont('Interface\\Addons\\RollPlay\\FONTS\\IMFeENsc28P.TTF', 15, nil)
- textFr.txt[k]:SetTextColor(1, 1, 1, .8)
- textFr.txt[k]:SetText("")
- -- textFr.txt[k]:SetSize(textFr:GetWidth(),textFr:GetHeight()+100)
- textFr.txt[k]:SetSize(tW,20)
- textFr.txt[k]:SetJustifyV("BOTTOM")
- textFr.txt[k]:SetJustifyH("LEFT")
- end
- incFrRply:SetSize(tW, tH)
- incFrRply:SetPoint('TOP', mPane, 'TOP')
- -- UIShow.pool = UIShow:CreateFontString(nil, "OVERLAY");
- -- UIShow.pool:SetFont('Interface\\Addons\\RollPlay\\FONTS\\IMFeENsc28P.TTF', 15, nil);
- -- UIShow.pool:SetTextColor(.8, .2, .1, .8)
- -- UIShow.pool:SetPoint("LEFT", UIShow, "LEFT", 215, -55);
- -- UIShow.pool:SetText("Points remaining: "..Rllply.train);
- -- local function ptcheck()
- -- if Rllply.train<=0 then
- -- -- UIShow.pool:Hide()
- -- end
- -- end
- -- ptcheck()
- local hbar_L=200
- local hbar_V=30
- local tbar_L=hbar_L
- local tbar_V=hbar_V-30
- UIShow.h = CreateFrame("Frame", nil, UIShow)
- UIShow.h:SetPoint('TOP', UIShow, 'TOP', 0, 0)
- UIShow.h:SetSize(tW, tH)
- UIShow.h.fr=UIShow.h:CreateTexture('')
- UIShow.h.fr:SetTexture('Interface\\COMMON\\friendship-parts')
- UIShow.h.fr:SetSize(300, 40)
- UIShow.h.fr:SetPoint('TOPLEFT', UIShow.h, 'TOPLEFT', hbar_L+10, hbar_V-40)
- UIShow.h.fr:SetTexCoord(.01, 1, 0, 1)
- UIShow.h.fr:SetDrawLayer('BACKGROUND', 2)
- UIShow.h.bg=UIShow.h:CreateTexture('')
- UIShow.h.bg:SetTexture('Interface\\BUTTONS\\YELLOWORANGE64')
- UIShow.h.bg:SetPoint('TOPLEFT', UIShow.h, 'TOPLEFT', hbar_L+26, hbar_V-51)
- UIShow.h.bg:SetSize(hb_wid, 9)
- UIShow.h.bg:SetDrawLayer('BACKGROUND', 1)
- UIShow.h.bg:SetVertexColor(.7, .2, .2)
- UIShow.t = CreateFrame("Frame", nil, UIShow)
- UIShow.t:SetPoint('TOP', UIShow, 'TOP', 0, 0)
- UIShow.t:SetSize(tW, tH)
- UIShow.t.fr=UIShow.t:CreateTexture('')
- UIShow.t.fr:SetTexture('Interface\\COMMON\\friendship-parts')
- UIShow.t.fr:SetSize(300, 40)
- UIShow.t.fr:SetPoint('TOPLEFT', UIShow.t, 'TOPLEFT', tbar_L+10, tbar_V-40)
- UIShow.t.fr:SetTexCoord(.01, 1, 0, 1)
- UIShow.t.fr:SetDrawLayer('BACKGROUND', 2)
- UIShow.t.bg=UIShow.t:CreateTexture('')
- UIShow.t.bg:SetTexture('Interface\\BUTTONS\\YELLOWORANGE64')
- UIShow.t.bg:SetPoint('TOPLEFT', UIShow.t, 'TOPLEFT', tbar_L+26, tbar_V-51)
- UIShow.t.bg:SetSize(hb_wid, 9)
- UIShow.t.bg:SetDrawLayer('BACKGROUND', 1)
- UIShow.t.bg:SetVertexColor(.9, .9, .4)
- local resetS=CreateFrame("Button", nil, UIShow, "SecureHandlerClickTemplate")
- resetS:SetPoint('TOPLEFT', UIShow.t, 'TOPLEFT', tbar_L+10, tbar_V-42)
- resetS:SetSize(24, 24)
- resetS:SetNormalTexture("Interface\\COMMON\\Indicator-Yellow")
- resetS:SetPushedTexture("Interface\\COMMON\\Indicator-Red")
- resetS:SetHighlightTexture("Interface\\COMMON\\RingBorder")
- resetS:RegisterForClicks('AnyUp')
- local resetH=CreateFrame("Button", nil, UIShow, "SecureHandlerClickTemplate")
- resetH:SetPoint('TOPLEFT', UIShow.h, 'TOPLEFT', hbar_L+11, hbar_V-40)
- resetH:SetSize(24, 24)
- resetH:SetNormalTexture("Interface\\COMMON\\friendship-heart")
- resetH:SetHighlightTexture("Interface\\COMMON\\RingBorder")
- resetH:RegisterForClicks('AnyUp')
- local function hbar(x)
- if x<=0 then x=1 end
- if x>=rlpl_stats.health then x=rlpl_stats.health end
- local z=(x/rlpl_stats.health)*hb_wid
- UIShow.h.bg:SetSize(z, 9)
- end
- function tbar(x)
- if x<=0 then x=.01 end
- if x>=rlpl_stats.train then
- x=rlpl_stats.train
- end
- local z=(x/10)*hb_wid
- UIShow.t.bg:SetSize(z, 9)
- end
- local catWidth=#cats * 50
- local function frCreate(cat, catNum, iconName)
- UIShow[cat]=CreateFrame("Button", nil, UIShow, "SecureHandlerClickTemplate" )
- UIShow[cat]:SetSize(btn_sz, btn_sz)
- UIShow[cat]:SetPoint("TOP", UIShow, "TOP", -280+catNum*40, bheight)
- UIShow[cat]:RegisterForClicks("AnyUp")
- UIShow[cat]:SetNormalTexture("Interface\\ICONS\\"..iconName)
- UIShow[cat]:SetPushedTexture("Interface\\BUTTONS\\UI-Quickslot-Depress")
- UIShow[cat]:SetHighlightTexture("Interface\\BUTTONS\\GLOWSTAR")
- UIShow[cat]:SetScript("OnClick", function()
- local tgt=UnitName('target')
- if tgt~=nil then
- if Rllply.health>0 and able_combat==true then
- if cooldown==false then
- PlaySoundFile(d20)
- RlPl_roll(cat, 'atk', tgt)
- else
- ffrm(.3, .3, 1, colors.Dexterity, .5, nil, 5, nil)
- prnt('You must wait five seconds between attacks', colors.warn)
- end
- else
- ffrm(.3, .3, 1, colors.Dexterity, .5, nil, 5, nil)
- prnt('You are too weakened to attack!', colors.warn)
- end
- else
- SendChatMessage('uses their '..string.lower(cats[cat])..' to no avail.', 'EMOTE')
- end
- end)
- UIShow[cat].name=UIShow:CreateFontString()
- UIShow[cat].name:SetPoint("BOTTOM",UIShow[cat],"TOP",0,0)
- UIShow[cat].name:SetFont('Interface\\Addons\\RollPlay\\FONTS\\IMFeENsc28P.TTF', 15, nil)
- UIShow[cat].name:SetTextColor(.3, .2, .1, .8)
- UIShow[cat].name:SetText(cats[cat]:sub(1,3)..":")
- UIShow[cat].name:SetSize(100, 20)
- UIShow[cat].amt=UIShow:CreateFontString()
- UIShow[cat].amt:SetPoint("TOP",UIShow[cat],"BOTTOM",0,2)
- UIShow[cat].amt:SetFont("Interface\\Addons\\RollPlay\\FONTS\\IMFeENsc28P.TTF", 15, nil)
- UIShow[cat].amt:SetTextColor(.1, .1, .1, .8)
- UIShow[cat].amt:SetText(Rllply[cat])
- UIShow[cat].amt:SetSize(100, 20)
- UIShow[cat].inc=CreateFrame("Button", nil, incFrRply, "SecureHandlerClickTemplate")
- UIShow[cat].inc:SetNormalTexture("Interface\\BUTTONS\\UI-MicroButton-BStore-Up")
- UIShow[cat].inc:SetPushedTexture("Interface\\BUTTONS\\UI-MicroButton-BStore-Down")
- UIShow[cat].inc:SetHighlightTexture('Interface\\BUTTONS\\GLOWSTAR')
- UIShow[cat].inc:SetPoint('BOTTOM', UIShow[cat], 'BOTTOM', 0, 0)
- UIShow[cat].inc:SetSize(btn_szx, btn_szy)
- UIShow[cat].inc:RegisterForClicks("AnyUp")
- UIShow[cat].inc:SetScript("OnClick", function ()
- if Rllply[cat]<5 and Rllply.train>=1 then
- PlaySoundFile(ping)
- Rllply[cat]=Rllply[cat]+1
- Rllply.train=Rllply.train-1
- tbar(Rllply.train)
- UIShow[cat].amt:SetText(Rllply[cat])
- if Rllply.train <= 0 then
- incFrRply:Hide() -- xyzzy
- end
- else
- ffrm(.3, .3, 1, colors.Dexterity, .5, nil, 5, nil)
- prnt('capped', colors.warn)
- end
- end)
- end
- -- frCreate('vit', 1, "PetBattle_Health")
- frCreate('str', 1, "Spell_Nature_Strength")
- frCreate('dex', 2, "INV_sword_1h_garrison_a_05")
- frCreate('chr', 3, "Spell_Shadow_Charm")
- frCreate('wis', 4, "TRADE_ARCHAEOLOGY_HIGHBORNE_SCROLL")
- frCreate('int', 5, "Spell_Shadow_Brainwash")
- mPane.tggl:SetScript("OnClick", function ()
- PlaySoundFile(d20)
- if msTog==false then
- UIShow:Show()
- if UIShow:IsVisible()==false then
- print('[RollPlay]: Can\'t toggle frame during spellcasting')
- end
- msTog=true
- accepting_combat=true
- else
- UIShow:Hide()
- if UIShow:IsVisible()==true then
- print('[RollPlay]: Can\'t toggle frame during spellcasting')
- end
- msTog=false
- accepting_combat=false
- end
- -- end
- end)
- if Rllply.train<=0 then
- -- UIShow.pool:Hide()
- incFrRply:Hide()
- -- for k,v in pairs(Rllply) do
- -- if UIShow[k]~=nil then
- -- UIShow[k].inc:SetWidth(0)
- -- end
- -- end
- end
- if Rllply.health<=0 then
- able_combat=false
- end
- hbar(Rllply.health)
- tbar(Rllply.train)
- local function multyPlecksR(self, event, msg, snd, hm, cnName, shortName, hmm)
- local chan='xtensionxtooltip2'
- local id,name=GetChannelName(chan)
- local data={}
- local itr=0
- if event=='CHAT_MSG_CHANNEL' and string.find(cnName, chan) then
- local dash=string.find(snd, '-')
- local send=''
- if dash~=nil then
- send=string.sub(snd, 1, dash-1)
- else
- send=snd
- end
- for word in string.gmatch(msg, '%S+') do
- itr=itr+1
- data[itr]=word
- end
- if data[1]=='RlPl' then
- if data[4]==plyr then
- if data[3]=='atk' then
- if accepting_combat==true then
- if able_combat==true then
- RlPl_roll(data[2], 'dfd', send)
- else
- prnt(send..' ruthlessly presses their attack.', colors.Strength)
- end
- else
- -- prnt('You fend off an attack')
- end
- elseif data[3]=='dfd' then
- if pending[send]~=nil then
- local diff=pending[send]-data[5]
- SendChatMessage('RlPl bcast '..send..' '..diff.. ' '..data[2], 'CHANNEL', nil, id)
- end
- end
- elseif data[2]=='bcast' then
- local distan=CheckInteractDistance(send, 4)
- if distan==true then --1 = inspect, 4 = follow
- local diff=tonumber(data[4])
- if diff>0 then
- wld='beaten'; iject=' by a margin of ('..math.abs(diff)..')'
- elseif diff<0 then
- wld='lost to'; iject=' by a margin of ('..math.abs(diff)..')'
- else
- wld='come to a draw with'; iject=''
- end
- local result=send..' has '..wld..' '..data[3]..iject..' in a contest of '..cats[data[5]]..'!' -- send is always the attacker, announcing results of their own fight
- local loss=false
- if data[3]==plyr and wld=='beaten' then loss=true end
- if send==plyr and wld=='lost to' then loss=true end
- if loss==true then
- PlaySoundFile(wound[hh])
- ffrm(.5, .5, 2, colors[cats[data[5]]], .5, nil, 5, nil)
- Rllply.health=Rllply.health-1
- hbar(Rllply.health)
- if Rllply.health==0 then
- prnt('You\'ve been utterly defeated... for now.', colors.Wisdom)
- --loss sequence
- end
- end
- prnt(result, colors[cats[data[5]]])
- end
- end
- end
- end
- end
- if not roll_listener then
- roll_listener=CreateFrame('Frame', nil, mPane)
- roll_listener:RegisterEvent('CHAT_MSG_CHANNEL')
- roll_listener:SetScript('OnEvent', multyPlecksR)
- end
- local function resetStats()
- for k,v in pairs(Rllply) do
- Rllply[k]=rlpl_stats[k];
- end
- for k,v in pairs(cats) do
- UIShow[k].amt:SetText(Rllply[k])
- end
- incFrRply:Show()
- tbar(Rllply.train)
- end
- local function resetHealth()
- local function fillup()
- hbar(10)
- able_combat=true
- PlaySoundFile('Sound\\Spells\\SPELL_MK_ENVELOPINGMISTS_HEAL.OGG')
- ffrm(.5, .5, 2, colors.reset, .5, nil, 5, nil)
- prnt('You feel much better', colors.reset)
- end
- if faction=='Horde' then
- if dist(spirits[1], spirits[2])<.003 then
- fillup()
- else
- ffrm(.3, .3, 1, colors.Dexterity, .5, nil, 5, nil)
- prnt('You must find Sijambi in the Valley of Spirits for rejuvenation!', colors.warn)
- end
- else --Alliance
- if dist(cathedral[1], cathedral[2])<.006 then
- -- if 2>1 then
- fillup()
- else
- ffrm(.3, .3, 1, colors.Dexterity, .5, nil, 5, nil)
- prnt('You must go to the altar in the Cathedral of Stormwind for rejuvenation!', colors.warn)
- end
- end
- end
- function trainTggl()
- if train_state=='off' then
- mPane:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- prnt('Training mode! Whack a dummy. A wooden one.', colors.Charisma)
- resetS:SetNormalTexture("Interface\\COMMON\\Indicator-Green")
- train_state='on'
- elseif train_state=='on' then
- mPane:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- prnt('You relax from training.', colors.Charisma)
- resetS:SetNormalTexture("Interface\\COMMON\\Indicator-Yellow")
- train_state='off'
- end
- end
- resetS:SetScript('OnClick', function()
- if Rllply.train>=rlpl_stats.train and train_state=='off' then
- prnt('You have already trained enough', colors.warn)
- else
- trainTggl()
- end
- end)
- resetH:SetScript('OnClick', function()
- resetHealth()
- end)
- prnt('Bailey bids you welcome, traveler.', colors.white)
- end --RlPl_layout
- function mPaneOnEvent(table_val, event, addon, ...)
- if event=='ADDON_LOADED' and addon=='RollPlay' then
- if Rllply==nil then Rllply={} end
- for k,v in pairs(rlpl_stats) do
- if Rllply[k]==nil or dev_mode==true then
- Rllply[k]=v
- end
- end
- RlPl_layout()
- elseif event=='PLAYER_LOGOUT' and addon=='RollPlay' then
- elseif event=='COMBAT_LOG_EVENT_UNFILTERED' then
- local spell, maybe_isEnemy, plyGUID, playName, maybe_spellID, who_knows, tarGUI, tarName, xx, yy, zz= ...
- if playName~=nil and playName==plyr then
- if tarName~=nil then
- if string.find(tarName, 'ummy') then
- if spell=='SPELL_CAST_SUCCESS' or spell=='SWING_DAMAGE' then
- if Rllply.train<rlpl_stats.train then
- Rllply.train=Rllply.train+1
- tbar(Rllply.train)
- if Rllply.train==rlpl_stats.train then
- -- resetStats()
- --rewriting resetStats for scoping here
- for k,v in pairs(Rllply) do
- Rllply[k]=rlpl_stats[k];
- end
- for k,v in pairs(cats) do
- UIShow[k].amt:SetText(Rllply[k])
- end
- incFrRply:Show() -- xyzzy
- tbar(Rllply.train)
- --end resetStats
- ffrm(.3, .3, 1, colors.Charisma, .5, nil, 5, nil)
- prnt('Excellent work, you\'re in peak form.', colors.Charisma)
- trainTggl()
- end
- else
- prnt('Already max trained!'); mPane:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
- end
- -- print(spell, maybe_isEnemy, plyGUID, playName, maybe_spellID, who_knows, tarGUI, tarName, xx, yy, zz)
- end
- end
- end
- end
- end
- end
- mPane:SetScript('OnEvent', mPaneOnEvent)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement