SphereCommunity
NPCs casting - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: NPCs casting (/Thread-NPCs-casting)



NPCs casting - x77x - 11-02-2015 01:58 AM

back in the old days to get a NPC to cast certain spells

you gave them a newbied invisible spellbook, with only the spells you wanted in it


tried that today, and it doesnt work...
(human brain)

what is the suggested way to make an NPC only cast the spells you want?

also

how could you adjust the weapon attack to spell ratio?
(so they only cast every so often, and not all the time)


RE: NPCs casting - XuN - 11-02-2015 06:40 PM

NPCs must have the required MAGERY for that spell to cast it, the same with mana (they consume mana too) and there's no need to have an invisible spellbook, just create it with ITEMNEWBIE.

To prevent them casting just do some rand checks in @SpellSelect trigger or @NPCActFight http://wiki.sphere.torfo.org/index.php/@NPCActFight


RE: NPCs casting - x77x - 11-02-2015 09:49 PM

they have magery and mana

and its invis so no one sees it =)
(i dont want it in their hands)

i tried both brain human and monster
still nothing...

ideas?


RE: NPCs casting - x77x - 11-12-2015 09:30 AM

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.NAME.HUE color_wei
   TITLE=Ambush
   NPC=brain_human
   COLOR=colors_skin
   STR={75 100}
   DEX={45 55}
   INT={45 55}
   MAXHITS 100
   MAXSTAM 100
   MAXMANA 500
   MAGERY=100.0
   PARRYING={50.0 75.0}
   TACTICS={50.0 75.0}
   WRESTLING={60.0 70.0}
   HIDING=100.0
   STEALTH=100.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_lit

he does not cast firefield...
also
i want him to hide and stay hidden

he will be hidden sometimes when he originally spawns, the second he steps hes revealed and never goes back to hidden


RE: NPCs casting - darksun84 - 11-12-2015 07:22 PM

Toggle spellflag_playeronly from firefield and add spellflag_targ_char. Npc doesn't cast spells with spellflag_targ_xyz


RE: NPCs casting - x77x - 11-12-2015 10:11 PM

so i need to do that for EVERY spell i plan to have NPCs use...

if spellflag_playeronly is present

k thanks


RE: NPCs casting - x77x - 11-13-2015 08:04 AM

default is

Code:
FLAGS=spellflag_dir_anim|spellflag_targ_xyz|spellflag_harm|spellflag_damage|spel​lflag_fx_targ|spellflag_field|spellflag_playeronly

ive tried

Code:
FLAGS=spellflag_dir_anim|spellflag_targ_xyz|spellflag_harm|spellflag_damage|spel​lflag_fx_targ|spellflag_field

Code:
FLAGS=spellflag_dir_anim|spellflag_targ_xyz|spellflag_harm|spellflag_damage|spel​lflag_fx_targ|spellflag_field|spellflag_targ_char

Code:
FLAGS=spellflag_dir_anim|spellflag_harm|spellflag_damage|spellflag_fx_targ|spell​flag_field|spellflag_targ_char


still nothing...

BUILD 2569


RE: NPCs casting - darksun84 - 11-13-2015 09:15 AM

Me build 2543 and works fine, remember when you change spells FLAGS or spell resources you have to restart the server


RE: NPCs casting - x77x - 11-13-2015 12:22 PM

thats what i was thinking...

i was doing resync

ill keep trying, thanks


RE: NPCs casting - x77x - 11-14-2015 03:53 AM

still nothing, restarted after ever change

gave the npc only magery no wresting or swords
brain human, brain monster
500 mana

maybe its the build
or maybe another script is stopping the cast...

*keep digging*