The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPCs casting
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
NPCs casting
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)

Dragons of Time 2000-2020
http://dragonsoftime.com
11-02-2015 01:58 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: NPCs casting
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
11-02-2015 06:40 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #3
RE: NPCs casting
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?

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 11-03-2015 10:11 AM by x77x.)
11-02-2015 09:49 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #4
RE: NPCs casting
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

Dragons of Time 2000-2020
http://dragonsoftime.com
11-12-2015 09:30 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: NPCs casting
Toggle spellflag_playeronly from firefield and add spellflag_targ_char. Npc doesn't cast spells with spellflag_targ_xyz
11-12-2015 07:22 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #6
RE: NPCs casting
so i need to do that for EVERY spell i plan to have NPCs use...

if spellflag_playeronly is present

k thanks

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 11-12-2015 10:12 PM by x77x.)
11-12-2015 10:11 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #7
RE: NPCs casting
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

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 11-13-2015 08:33 AM by x77x.)
11-13-2015 08:04 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: NPCs casting
Me build 2543 and works fine, remember when you change spells FLAGS or spell resources you have to restart the server
11-13-2015 09:15 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #9
RE: NPCs casting
thats what i was thinking...

i was doing resync

ill keep trying, thanks

Dragons of Time 2000-2020
http://dragonsoftime.com
11-13-2015 12:22 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #10
RE: NPCs casting
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*

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 11-14-2015 04:46 AM by x77x.)
11-14-2015 03:53 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)