SphereCommunity
NPC/Monster - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: NPC/Monster (/Thread-NPC-Monster)



NPC/Monster - kn4tseb - 05-17-2014 04:32 AM

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


RE: NPC/Monster - Alaric - 05-17-2014 05:28 AM

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.


RE: NPC/Monster - kn4tseb - 05-17-2014 06:13 AM

ehmmm ... will try, sounds hard BTW xdd!

Thanks Alaric.


RE: NPC/Monster - Alaric - 05-17-2014 06:33 AM

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


RE: NPC/Monster - kn4tseb - 05-17-2014 07:30 AM

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...


RE: NPC/Monster - Alaric - 05-17-2014 08:13 AM

Then you'll have to think of some storage tag instead of link on one person and allow anybody pick up the item.


RE: NPC/Monster - kn4tseb - 05-17-2014 10:42 AM

will do