SphereCommunity

Full Version: LOS attack?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how can i get these guys to actually attack players passing by?

[Image: ambush.jpg]

also
how can i get the fire soldiers to attack with fire? they arent using the invis spellbook i gave them!

what would be amazing is throw torches and when they hit the ground, fire field goes off =)

how can i get them to throw rocks like ogres do?

Code:
[CHARDEF c_wei_infantry_ambush_f]
ID=c_man
NAME=Soldier [Wei]
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_MOUNT
//DAM=
//ARMOR=
DESIRES=r_civilization,t_coin,t_gold,t_gem,t_potion
AVERSIONS=t_trap,e_carnivores3
FOODTYPE=t_food,t_drink,t_fruit,t_grain
//MAXFOOD=20
RESOURCES=i_flesh_head_2, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg
BLOODCOLOR=colors_blood
MOVERATE=190
TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TSPEECH=s_army_commands
TEVENTS=e_Human_HearUnk
TEVENTS=e_army_soldier
CATEGORY=3KUO
SUBSECTION=Soldiers - Wei
DESCRIPTION=Infantry (ambush fire)
ON=@Create
TAG.MILITARY 1
LEVEL={1 14}
TAG.ARMY Wei
TAG.ARMYNUMBER=040004000
TAG.NAME.HUE color_wei
   TITLE=Ambush
   NPC=brain_human
   //NPC=brain_monster
   COLOR=colors_skin
   STR={75 100}
   DEX={45 55}
   INT=100
   MAXHITS=100
   MAXSTAM=100
   MAXMANA=500
   FAME=1000
   MAGERY=100.0
   PARRYING={50.0 75.0}
   TACTICS={50.0 75.0}
   WRESTLING={60.0 70.0}
   HIDING=200.0
   STEALTH=200.0
//
   ITEMNEWBIE=random_male_hair
   COLOR=colors_hair
   ITEMNEWBIE=random_facial_hair,1,R5
   COLOR=match_hair
   ITEMNEWBIE=i_military_cap
   ITEMNEWBIE=i_military_leggings
   ITEMNEWBIE=i_military_tunic
   ITEMNEWBIE=i_military_overplate
   ITEMNEWBIE=i_military_boots
   ITEMNEWBIE=i_military_apron
   COLOR=color_wei
   ITEMNEWBIE=i_military_uniform
   COLOR=color_wei
//
   ITEMNEWBIE=i_military_mempo
//
   ITEMNEWBIE=i_spellbook
   MORE1=08000000//FF
   MORE2=00
//
ON=@NPCRestock
   ITEM=random_coin_purse
   ITEM=i_torch

[CHARDEF c_wei_infantry_ambush_a]
ID=c_man
NAME=Soldier [Wei]
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_MOUNT
//DAM=
//ARMOR=
DESIRES=r_civilization,t_coin,t_gold,t_gem,t_potion
AVERSIONS=t_trap,e_carnivores3
FOODTYPE=t_food,t_drink,t_fruit,t_grain
//MAXFOOD=20
RESOURCES=i_flesh_head_2, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg
BLOODCOLOR=colors_blood
MOVERATE=190
TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TSPEECH=s_army_commands
TEVENTS=e_Human_HearUnk
TEVENTS=e_army_soldier
CATEGORY=3KUO
SUBSECTION=Soldiers - Wei
DESCRIPTION=Infantry (ambush archer)
ON=@Create
TAG.MILITARY 1
LEVEL={1 14}
TAG.ARMY Wei
TAG.ARMYNUMBER=040004000
TAG.NAME.HUE color_wei
   TITLE=Ambush
   NPC=brain_human
   COLOR=colors_skin
   STR={75 100}
   DEX={45 55}
   INT=100
   MAXHITS 100
   MAXSTAM 100
   MAXMANA 100
   FAME=1000
   ANATOMY={50.0 75.0}
   HEALING={50.0 75.0}
   MAGICRESISTANCE={20.0 30.0}
   PARRYING={50.0 75.0}
   ARCHERY={80.0 100.0}
   TACTICS={50.0 75.0}
   WRESTLING={20.0 30.0}
   HIDING=200.0
   STEALTH=200.0
//
   ITEMNEWBIE=random_male_hair
   COLOR=colors_hair
   ITEMNEWBIE=random_facial_hair,1,R5
   COLOR=match_hair
   ITEMNEWBIE=i_military_cap
   ITEMNEWBIE=i_military_leggings
   ITEMNEWBIE=i_military_tunic
   ITEMNEWBIE=i_military_overplate
   ITEMNEWBIE=i_military_boots
   ITEMNEWBIE=i_military_apron
   COLOR=color_wei
   ITEMNEWBIE=i_military_uniform
   COLOR=color_wei
//
   ITEMNEWBIE=i_military_mempo
//
   ITEMNEWBIE=i_military_quiver
   ITEM=i_arrow,{20 40}
//
ON=@NPCRestock
   ITEM=random_coin_purse
   ITEM=i_bow

Code:
[events e_army_soldier]
ON=@NPCLookAtChar//TO INTERACT WITH NPCS
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    ATTACK <SRC>
    ELIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK MILITARY CRIMINALS
    Say Beat it military criminal!
    ATTACK <SRC>
    ELIF (<SRC.MEMORYFINDTYPE.0400.LINK> > 040004010)//ATTACK every PLAYER made guild
    ATTACK <SRC>
    ENDIF
ELSEIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK CIVILIAN CRIMINALS
    Say Beat it civilian criminal!
    ATTACK <SRC>
ENDIF

ON=@NotoSend//2 ALLY 5 ENEMY 6 RED    
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    //IF !<GUILD>
    ARGN1=5
    ELIF (<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    //ELIF <GUILD>
    ARGN1=2
    ENDIF
ENDIF

ON=@GetHit
IF (<SRC.TAG0.MILITARY>)
    IF (<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    src.criminal 1
    ENDIF
ENDIF
no ideas?

ON=@click or something ???
tried it
npcseenewplayer doesnt work

Code:
[events e_ambush]
//ON=@NPCSeeNewPlayer//TO INTERACT WITH PLAYERS
ON=@click//TO INTERACT WITH PLAYERS
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    ATTACK <SRC>
    ELIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK MILITARY CRIMINALS
    Say Beat it military criminal!
    ATTACK <SRC>
    ELIF (<SRC.MEMORYFINDTYPE.0400.LINK> > 040004010)//ATTACK every PLAYER made guild
    ATTACK <SRC>
    ENDIF
ELSEIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK CIVILIAN CRIMINALS
    Say Beat it civilian criminal!
    ATTACK <SRC>
ENDIF

i dont think click worked either...

hmmm

ground trigger or something?
Every char (player/NPC) check LOS before start many actions, on players you can use GM=1 to skip these checks but on NPCs there's no way to skip it

maybe if you add some specific flags on the char (statf_insubstantial or statf_hovering) it can help, but I think it's not enough to fully skip LOS checks

so I think the best workaround in this case is just move the NPC to the road but set Z+40 on NPC to make it "fly" over the mountain
so its not possible, =(

how can you keep them hidden, stop them from walking around? they just walk around and unhide then hide
also
how can i get the fire soldiers to attack with fire? they arent using the invis spellbook i gave them!
what would be amazing is throw torches and when they hit the ground, fire field goes off =)
and/or
how can i get them to throw rocks like ogres do?

what about something like...

Code:
ON=@Create
SRC.FLAGS |= statf_freeze

Code:
[events e_ambush]
ON=@NPCSeeNewPlayer//TO INTERACT WITH PLAYERS
//ON=@click//TO INTERACT WITH PLAYERS
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG0.ARMYNUMBER>==<TAG0.ARMYNUMBER>)
    ATTACK <SRC>
    ELIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK MILITARY CRIMINALS
    Say Beat it military criminal!
    ATTACK <SRC>
    ELIF (<SRC.MEMORYFINDTYPE.0400.LINK> > 040004010)//ATTACK every PLAYER made guild
    ATTACK <SRC>
    ENDIF
ELSEIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK CIVILIAN CRIMINALS
    Say Beat it civilian criminal!
    ATTACK <SRC>
ENDIF

ON=@CombatStart
FLAGS & =~ statf_freeze

ON=@CombatEnd
FLAGS |= statf_freeze
You can set THROWOBJ in the char definition to an ID of an item you wish the char to throw. You can also set THROWRANGE and THROWDAM. It's in the wiki btw ;-)
awesome... BUT
on=@create
THROWOBJ=i_torch_lit
THROWDAM=5,10
THROWRANGE=5

they dont throw shit... tried it above on=@create and same

any idea about the other stuff?
(use the invis spellbooks i gave them? stay hidden until they attack? then go back to hiding when are done? )

and the other thing you were supposed to check 3 weeks ago? =)

oh hey, theres a nice bug...
as your running away from an enemy you can tab out of warmode and click the hide button, an npc will stop attacking you and walk away... this is normal?
Reference URL's