Results 1 to 2 of 2

Thread: [WSS (War Script Series)] Hold Target with talk action

  1. #1
    Normal User
    Join Date
    Sep 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    [WSS (War Script Series)] Hold Target with talk action

    Still on testing phase however primary tests turned out positive.
    Add all these to your current HUD:

    Code:
    local AutoAttack = false -- FALSE won't attack even if it has a holded target, TRUE it will attack the holded target
    local AttackSkulled = false -- TRUE attacks even if the enemy isn't skulled, FALSE attacks only if enemy has skull
    Code:
    -- Boolean for Auto Attack
    if AutoAttack == true then
    	setfontcolor(rgbcolor(0, 255, 0))
    	addtext("Auto Attack - ON", startposx,startposy+460)
    else
    	setfontstyle(fontfamily, fontsize, fontcolor)
    	setfontcolor(rgbcolor(205, 200, 177))
    	addtext("Auto Attack - OFF", startposx,startposy+460)
    end
    Code:
    -- Boolean for Attack Only Skulled
    if AttackSkulled == true then
    	setfontcolor(rgbcolor(255, 0, 0))
    	addtext("Attack Only Skulled - OFF", startposx, startposy+475)
    else
    	setfontstyle(fontfamily, fontsize, fontcolor)
    	setfontcolor(rgbcolor(0, 255, 0))
    	addtext("Attack Only Skulled - ON", startposx,startposy+475)
    end
    This is just a user end code, meaning this isn't the "working code" just the talkaction so you know who you will attack.
    Change the end channel and the leader.
    Code:
    local msgs = getmessages("NPCs")
    local leader = "MYLEADER"
    local qtd = msgs.count-1
    local current = {}
    local onlyskulls = true
    local nlength = leader:len()
    local levela = tostring(level)
    local levellen = levela:len()
    local tlength = 20 + nlength + levellen
    
    
    if msgs[qtd].text:find("!attack ") and msgs[qtd].sender == leader then
    	table.insert(current,0, msgs[qtd].text:sub(tlength))
    end
    
    setfontstyle(fontfamily, fontsize, fontcolor)
    setfontcolor(rgbcolor(205, 200, 177))
    addtext("Hold Target: " .. current[0], startposx, startposy+490)
    Finally the code.
    Code:
    -- Attack target if AutoAttack enabled
    if AutoAttack == true then
    	for i=0,pqtd-1 do
    		if AttackSkulled == true then
    			for k=3,5 do
    				if pgot[i].name == current[0] and pgot[i].skull == k then
    					attack(current[0])
    				else
    					return false
    				end	
    			end
    		else
    			if pgot[i].name == current[0] then
    				attack(current[0])
    			else
    				return false
    			end	
    		end
    	end
    else
    return false
    end
    Examples (using local chat channel as default):
    !attack Bubbles

    Bubbles becomes the current target and will hold the target on screen, contemplating if she has skull or not.

    Other examples:
    !attack Eternal Oblivion
    !attack Zu

    BATTLE LIST MUST BE OPEN AT ALL TIMES.

    Enjoy please, if possible report all errors you find

    Known issues:
    - Since it takes the last message it can be replaced however with proper organization you can bypass this issue, trying to work it out.

    Fixed bugs:
    * Now it works with all levels

    Last update: 19/10/12
    Last edited by ErickLua; 10-19-2012 at 10:01 AM. Reason: Fixed the level issue

  2. #2
    Normal User
    Join Date
    May 2012
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    dosent work for my it only hold him once after he jump second time it wont work i added all as Hid is good?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •