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
NPC/Monster
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
NPC/Monster
ok ok, this is suppose to be a tricky one...

i need to create a monster that attacks every one on sight but if someone uses a key word "quest" for example, the monster checks if the player has = 10000 fame, if it has not, the monster say something like "you aren't worthy" and attack that player with massive hit or something; but if player has 10000 fame the monster says something like "show me what you got" and a new item is created in the loot of that monster but only the 10000 fame player can loot it. also if there are more players with equal 10000 fame saying the same "quest" word over and over again, and the "new item" is already as a loot, it wont be created again, so there will be only one of this item.

anyone? Smile

Thanks in advance
05-17-2014 04:32 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: NPC/Monster
Hmm, your motto certainly isn't - "the simpler, the better". Why are you making it so difficult for yourself? Classic quest system isn't better?

The worst thing would be forcing the npc attacking you I guess, the rest is just checking and lots of unnecessary code.
Use on=Quest under char definition (if it doesn't work, use speech block [speech spk_my_quest] and add it to that npc under tspeech=spk_my_quest)
Then the checking and prolly linking the new item on the certain player - give it event(or typedef?) which will remove the link when the item is picked up. (and also remove the event itself)
To force the npc attack you... i don't think its possible if you have the system (default one), that npcs attack randomly and change their targets. You can force the npc do some animation, say "Go to hell" and use damage function+some animation (a fireball for example) on the talker.

E: when i think about it... default link allows you to pick it up but not to equip it. In that case... add a checking line to the event mentioned above.
(This post was last modified: 05-17-2014 05:51 AM by Alaric.)
05-17-2014 05:28 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #3
RE: NPC/Monster
ehmmm ... will try, sounds hard BTW xdd!

Thanks Alaric.
05-17-2014 06:13 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #4
RE: NPC/Monster
in conclusion:
one reward item
one quest npc ( +speech block)
one event(resp. typedef) for the reward item

it shouldn't be that hard but there is lots of checking and solving side effects - like.. what will you do, if he says "quest" and goes away? if more people does that, it can be pissy.

I probably misunderstood... If you have 2 ppl saying quest, you want item for each or only one item? The system I said would create 1 item for 1 person. To achieve 1 item for more players... Uh... Just try it somehow and come with code issues Smile
(This post was last modified: 05-17-2014 06:43 AM by Alaric.)
05-17-2014 06:33 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #5
RE: NPC/Monster
just one item at all, untill it respawns and some1 else says the same "quest" word

so, bassicaly, no matter how many players say the "word" it will only be as loot once until respawns...
(This post was last modified: 05-17-2014 07:32 AM by kn4tseb.)
05-17-2014 07:30 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #6
RE: NPC/Monster
Then you'll have to think of some storage tag instead of link on one person and allow anybody pick up the item.
05-17-2014 08:13 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #7
RE: NPC/Monster
will do
05-17-2014 10:42 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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