ID:2226063
 
Code:


Problem description: How i do a NPC who will use the exactly verbs who players have. If player 1 fight him, he will use the same powers that player 1 have. If player 2 fight him, he will use the same powers that player 2 have. Idk how to do this




I think you should add new variable for player like ...
"var/actionVar", and change it when you use any verb.
mob/var/actionVar
mob/var/SomeSkill()
...
src.actionVar="SomeSkill"
...

also you can just use call proc in NPC AI loop.I think you use any Target var... so this isn't problem...easy.
You want the AI to use the exact same skill as the player exactly when the player uses it? Or to simply have the same skill set as the player?
give the npc a empty list that populates with all the skills the player has then calls the verb based on what is used by the player or a random pick of the skills obtained then maybe clear the list when the player leaves the area
Yes, the NPC will fight with a player. He will get and use the same skill that the player have
A lot of this depends on how your skills are set up. Are you using lists of skill datums, skill objects with verbs, hard coded class verbs?
This is not the best way to do it but it is easiest to understand I think
//skill for players to use
obj/Ability/Kamehameha
verb
Kamehameha()
usr.FireKamehameha()

mob/proc/FireKamehameha()
//fire a kamehameha

mob/NPC
New()
NPC_AI()
proc
NPC_AI()
set waitfor=0
sleep(100)
FireKamehameha()
sleep(100)
del(src)
//when a new npc is made it waits 10 seconds then fires a
//kamehameha then waits 10 more seconds then deletes itself