Forum rules: Do not post bugs or feature requests here! Report bugs to our Issue Tracker and suggestions to Suggest a Feature.

This site is not for solicitation of services or 'purchasing' development. Please do not post requesting side mods/plugins and so on. Your thread will be removed, and you will receive a warning.
By Graham3D
#158096 I'm aware this is solely used for initiating a battle between two players; however, is there a way to initiate a battle between a specific "Trainer NPC" using a command?


My Goal
I am creating an event on my server using CustomNPC's that checks if you've defeated a very specific trainer. I can (or could) do this by simply following the specific steps:

1. Talk to the CustomNPC.
2. CustomNPC initiates a battle using /pokebattle [Pixelmon Trainer Name] @dp
3. PixelmonNPC drops "PokeBall" item.
3. Speak with CustomNPC again, NPC's dialog options update if player has a PokeBall in his or her inventory allowing for the next dialog option.
4. By updating your CustomNPC's global "PlayerData" with the new dialog option that opened up after receiving the PokeBall item, you can now cross the "Border" block that had it's availability set to the updated dialog after the battle.

User avatar
By MoeBoy76
#158103 You could do it, however it would spawn a new trainer of the type you selected with their default Pokemon, alternately you could have the NPC tp @p to a location with the trainer and then have the trainer tp them back
By Graham3D
#158141 You could do it, however it would spawn a new trainer of the type you selected with their default Pokemon, alternately you could have the NPC tp @p to a location with the trainer and then have the trainer tp them back

So you cannot have the TrainerNPC already spawned and execute a command that initiates a battle with that trainer? I do like the sounds of the alternate solution; although, it sounds kinda makeshift. How would the TrainerNPC teleport you back?

PS, can I add you on Skype? I only wish to speak regarding Pixelmon stuff when I have a fast question that arises. I have Noppes (CustomNPCs), as well as a few other mod devs on my friends list. I am 27 years old, and I won't spam you if that's a fear of yours lol.
By Graham3D
#158272 I spoke with Noppes directly on Skype and we discussed how I could achieve this. He made the suggestion of Creating the trainer and having it engage you on sight. Splash the trainer with an invisibility potion and cloning it with the CustomNPC's mob cloner which I can then use the command " /noppes clone spawn Red 0 50,50,50" to spawn the invisible trainer.

After dialog between the CustomNPC's has ended, I should be engaged by the TrainerNPC with all it's pokemon. I can then talk to the CustomNPC once more which will update my "Player Data" which in essence allows me to have significant rights to cross the border I placed down.


-----------
Update #1
--------------

I can save the TrainerNPC to the CustomNPC's Client / Server clone database; however, it fails to spawn. Looking more into this.

--------------
Update #2
--------------

I have successfully spawned the TrainerNPC, albeit, level 0 lol. It retains all it's Pokemon and their levels, moves, etc... CustomPN under skins was what was making it fail to load, I switched it back to the Steve skin and it loaded perfectly.
JOIN THE TEAM