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
Extra damage vs Monster
Author Message
Lincoln
Apprentice
*

Posts: 11
Likes Given: 13
Likes Received: 0 in 0 posts
Joined: Apr 2016
Reputation: 0



Post: #1
Extra damage vs Monster
Hello All,

Quick question!

If I wanted to make a weapon that caused extra damage towards 1 or multiple types of monsters, what is the best way of accomplishing that goal?

I put a tag on the weapon, so that if the weapon has a certain tag it is meant to cause extra damage towards a certain monster(s)

Sort of like the below

ITEMDEF i_blah_sword
name=blah sword
weight=1
type=t_weapon_sword

ON=@create
f_randomblah
tag.swordblah=(<tag.swordblah>)

on=@equip
events +e_swordboost

on=@unequip
events -e_swordboost

[function f_randomblah]
dorand 3
tag.swordblah=boo
tag.swordblah=rawr
rag.swordblah=meow
enddo

[events e_swordboost]
on=@hit
if (<tag0.swordblah>==boo)
strmatch("<src.body>","c_skeleton") || strmatch ("<src.body>","c_elem_water")
src.hits -{500 1000}
endif
if (<tag0.swordblah>==rawr)
strmatch("<src.body>","c_daemon")
src.hits -{500 1000)
endif


Sooo clearly it doesn't work!

Basically what happens now is that the sword will cause between 500 1000 damage to every monster!
What am I doing wrong (script above was just a rough thing, but same concept)

Any help would be appreciated as always!
(This post was last modified: 12-03-2016 12:11 AM by Lincoln.)
12-03-2016 12:10 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Extra damage vs Monster
probably the problem is on this line
Code:
ON=@create
f_randomblah
tag.swordblah=(<tag.swordblah>)
you set "TAG.SWORDBLAH=something" and later change to "TAG.SWORDBLAH=(something)", this will make the e_swordboost event fail because it search the tag "something" which is not the same of "(something)"

so you must remove this line "tag.swordblah=(<tag.swordblah>)" or change your e_swordboost event to include () brackets on the tag search

EDIT: you must also add [] brackets on this line ITEMDEF i_blah_sword -> [ITEMDEF i_blah_sword]
(This post was last modified: 12-03-2016 01:29 AM by Coruja.)
12-03-2016 01:27 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #3
RE: Extra damage vs Monster
This also doesnt work "if (<tag0.swordblah>==boo)".

It has to be IF STRMATCH("<TAG.swordblah>","boo")
12-03-2016 01:54 AM
Find all posts by this user Like Post Quote this message in a reply
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #4
RE: Extra damage vs Monster
(12-03-2016 01:54 AM)pointhz Wrote:  This also doesnt work "if (<tag0.swordblah>==boo)".

It has to be IF STRMATCH("<TAG.swordblah>","boo")

No need for the quotes, all that does is compare the string including the quote marks

Doing this
STRMATCH("<TAG.swordblah>","boo")

Is like doing this
STRMATCH(WOOO<TAG.swordblah>WOOO,WOOObooWOOO)

ULTIMA ONE
The modern, sphere powered Ultima Online server
12-03-2016 03:22 AM
Visit this user's website 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)