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
Odd issue with my potion drinking EVENT.
Author Message
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #7
RE: Odd issue with my potion drinking EVENT.
IF (<RESTEST 1 i_potion_heal_minor>) && (<HITPOINTS> < (<STR>/2)) && (<EVAL RAND(5)> == 1)
EMOTE drink a <findid.i_potion_heal_minor.name>! // <--This works! (EDIT: I even removed the .name part and it'll display the UID of the potion it found in the character's pack.)
USEITEM <findid.i_potion_heal_minor>
return 1
ENDIF

Still doesn't work. Sad

Also tried:
findid.i_potion_heal_minor.useitem
findid.i_potion_heal_minor.use
USE <findid.i_potion_heal_minor>

Here's the entire code for everything related to the script..

The Event:
Code:
[EVENTS e_AI_Potion_Drinker]
ON=@GetHit
    IF (<RESTEST 1 i_potion_heal_minor>) && (<HITPOINTS> < (<STR>/2)) && (<EVAL RAND(5)> == 1)
            EMOTE drink a <findid.i_potion_heal_minor.name>!
            USEITEM <findid.i_potion_heal_minor>
                 return 1
    ENDIF

Potion itself:
Code:
[ITEMDEF I_POTION_HEAL_MINOR]
ID I_BOTTLE_SMALL_FULL
NAME Minor Heal Potion
TYPE T_POTION
VALUE
TDATA1 I_BOTTLE_SMALL_EMPTY
RESOURCES I_BOTTLE_SMALL_WATER,I_REAG_GINSENG 2
SKILLMAKE ALCHEMY 5.0
CATEGORY=Aetharia Magic Items
SUBSECTION=Potions
DESCRIPTION=Heal Minor
ON=@CREATE
COLOR 028
MORE1 S_HEAL_POTION
MORE2 30

[SPELL 805]
DEFNAME S_HEAL_POTION
NAME Heal
FLAGS SPELLFLAG_TARG_CHAR|SPELLFLAG_DIR_ANIM| SPELLFLAG_FX_TARG | SPELLFLAG_PLAYERONLY
RUNE_ITEM I_RUNE_ALCHEM_3
DURATION 2*60.0,4*60.0
ON=@EFFECT
IF <SRC.HITS> < <SRC.MAXHITS>
  SRC.HITS += <ARGO.dMORE2>
  IF <SRC.HITS> > <SRC.MAXHITS>
   SRC.HITS <SRC.MAXHITS>
  ENDIF
ENDIF

Changes to t_potion def:
Code:
[TYPEDEF T_POTION]
ON=@DCLICK
IF <TOPOBJ> != <SRC>
SRC.SYSMESSAGENEG <NAME> must be in your backpack.
RETURN 1
ENDIF

The test NPC with the event:
Code:
[CHARDEF c_m_alton_guard]
NAME=#NAMES_HUMANMALE the Alton City Guard
ID=BASE_C_ELF_MALE
DESIRES=i_gold,e_notoriety,t_magic
AVERSIONS=t_TRAP,t_eerie_stuff
TSPEECH=spk_human_prime
TSPEECH=jobGuard
TSPEECH=spk_needs
TSPEECH=spk_rehello
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk
TEVENTS=e_Human_Needs
TEVENTS=e_Human_ConvInit
TEVENTS=e_Human_Greet
TEVENTS=e_Human_Space
TEVENTS=e_Human_Refuse
TEVENTS=e_Human_Environ
TEVENTS=e_AI_Guard
TEVENTS=e_AI_Friendly
TEVENTS=e_AI_Potion_Drinker
CATEGORY=Alton Civilized
SUBSECTION=Guards
DESCRIPTION=Guard (male)

ON=@Create
    NPC=brain_human
    COLOR=colors_skin
    STR={100 150}
    DEX={100 150}
    INT={51 65}
    DETECTINGHIDDEN={90.0 100.0}
    FORENSICS={90.0 100.0}
    FENCING={90.0 100.0}
    PARRYING={90.0 100.0}
    SWORDSMANSHIP={30.0 50.0}
    WRESTLING={90.0 100.0}
    MACEFIGHTING={90.0 100.0}
    MAGICRESISTANCE={90.0 100.0}
    TACTICS={90.0 100.0}
    ITEMNEWBIE=random_male_hair
    COLOR=colors_hair
    ITEMNEWBIE=random_facial_hair
    COLOR=match_hair    

ON=@NPCRestock
    ITEM=i_shield_heraldic_bronze
    ITEM=i_broadsword_bronze
    ITEM=i_ringmail_tunic_iron
    ITEM=i_ringmail_sleeves_iron
    ITEM=i_ringmail_gloves_iron
    ITEM=i_leather_gorget
    ITEM=i_cape
    COLOR=colors_blue
    ITEM=i_sash
    COLOR=colors_blue
    ITEM=i_boots_thigh
    ITEM=i_potion_heal_minor,3
    ITEM=t_coin_purse

I'm *completely* stumped. I'm sure it's just a syntax problem with findid though, but what's wrong with it, I have no idea. :/

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 09-19-2012 09:03 AM by Rayvolution.)
09-19-2012 08:24 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Odd issue with my potion drinking EVENT. - Rayvolution - 09-19-2012 08:24 AM

Forum Jump:


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