Results 1 to 2 of 2

Thread: Action

  1. #1
    Normal User
    Join Date
    Jun 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    18
    Rep Power
    5

    Action

    Some1 have action to moving around when some1 is near you?
    anty skull action which moving around?

  2. #2
    Normal User Balbek's Avatar
    Join Date
    May 2012
    Location
    LDZ
    Posts
    554
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    84
    Rep Power
    6
    PHP Code:
    local function isPlayerOnTile(POSITION_XPOSITION_YPOSITION_Z)
        
    local TILE_DATA gettile(POSITION_XPOSITION_YPOSITION_Z)
        
        for 
    CURRENT_INDEX 0TILE_DATA.count do
            if (
    TILE_DATA.items[CURRENT_INDEX].id == 99 and TILE_DATA.items[CURRENT_INDEX].count <= 0x40000000then
                
    return true
            end
        end
        
        
    return false
    end


    if (30 >= target.hppc and target.id and paround(4) > 0then
        local POSITIONS
    FREE_DIRECTIONS = {{0= -1DIR = [[n]]}, {10DIR = [[e]]}, {01DIR = [[s]]}, {= -10DIR = [[w]]}}, {}
            
        if (
    isPlayerOnTile(posx POSITIONS[getcreature(id).direction 1].Xposy POSITIONS[getcreature(id).direction 1].Yposz)) then
            
    for _POSITION in ipairs(POSITIONS) do
                if (
    not isPlayerOnTile(posx POSITION.Xposy POSITION.Yposz)) then
                    table
    .insert(FREE_DIRECTIONSPOSITION.DIR)
                
    end
            end
            
            
    if(#FREE_DIRECTIONS > 0) then
                
    local TURN_DIRECTION FREE_DIRECTIONS[math.random(#FREE_DIRECTIONS)]


                
    while ((({[[n]], [[e]], [[s]], [[w]]})[getcreature(id).direction 1]) ~= TURN_DIRECTION) do
                    
    turn(TURN_DIRECTIONwait(2575)
                
    end
            end
        end
    end 
    by sirmate

Posting Permissions

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