Ariguna Wicaksana
Terrarian
Help me, i want to make magic weapon.
How would you like us to help you? What do you already have/know?Help me, i want to make magic weapon.
Could you show us the code you're using and is not working?Help
How I can use knockback resistance in my shield?
Because I use item.knockBackResist anddont work
I use in effects player.knockBackResist without success
Please help and sorry for bad English
The best thing you can do is the following:I know i made a thread asking this question and i really didn't mean to but i'm not too sure how to delete it but i thought i would most likely get more help here. All i'm really looking for is the code for King Slime or the Eoc and just a simple slime npc code the abomination's code is hard for me to work with(again i am really sorry for pasting a thread about this and then posting this here i just thought it would be a better idea and i am not sure how to delete that thread )
I could not seem to find it the one i did not(not sure if it's the right one or not) seems to freeze my pc or the program stops responding. This only happens when it starts to decompile the npc and nothing else lolThe best thing you can do is the following:
You can use this for all different NPCs.
- Download a program called 'IlSpy'.
- Drag and drop your Terraria.exe file (from the steam folder) into the IlSpy program.
- Look in the Terraria namespace and double click NPC.cs (might take a little while to decompile).
- [OPTIONAL] Copy + paste all the code from the NPC.cs into a file, which you can then open with notepad++ (makes scrolling and searching easier).
- Search for King Slime and you'll get to see the SetDefaults of the KingSlime NPC.
- In there you'll see the type check (else if (type == blabla)) take note of the value that is displayed there.
- You'll also see something like 'this.aiStyle = ' take note of the value of that too.
- You can then search for aiStyle == theTypeAIStyleYouNotedEarlier to search for the aiStyle that corresponds with the one from King Slime.
- This will contain the code of the King Slime, so now you can just scroll through this.
Hmm, you might want it to keep 'not responding' for a little while then (it freezes on me too ).I could not seem to find it the one i did not(not sure if it's the right one or not) seems to freeze my pc or the program stops responding. This only happens when it starts to decompile the npc and nothing else lol
it's been like an hour and it's still decompiling XD this is gonna be a long day for meHmm, you might want it to keep 'not responding' for a little while then (it freezes on me too ).
Decompiling the whole thing took me ~30 mins. (using the setup.bat from GH)it's been like an hour and it's still decompiling XD this is gonna be a long day for me
I guess you do like the example item dropping but specify npc for it.one more thing. Is there any way you can get a vanilla NPC to drop a custom Item. I could not find this in the example mod(sorry if i am asking too many questions or if they are stupid. Don't wanna be a bother )
well i mean like i could not find were the code was that was making NPC drop the example item and that too, i do not wan't every mob dropping an itemI guess you do like the example item dropping but specify npc for it.
Sadly i cannot help you right now, i need my pcwell i mean like i could not find were the code was that was making NPC drop the example item and that too, i do not wan't every mob dropping an item
Just check the npc.type in an if statement in a globalNPC.NPCLootwell i mean like i could not find were the code was that was making NPC drop the example item and that too, i do not wan't every mob dropping an item
you know, i saw the ExambleGlobalNPC.ce file but i really thought it was for the ExampleNPC and not a global code. Thanks i would of never figured that out XD but how do you get a specific mob to drop something or is that in the GlobalNpc.cs file as well?Just check the npc.type in an if statement in a globalNPC.NPCLoot
https://github.com/bluemagic123/tMo...ac2e7/ExampleMod/NPCs/ExampleGlobalNPC.cs#L38
What I linked you shows specific drops for DukeFishron. If you are doing a ModNPC you can do that in it's own NPCDrop method.you know, i saw the ExambleGlobalNPC.ce file but i really thought it was for the ExampleNPC and not a global code. Thanks i would of never figured that out XD but how do you get a specific mob to drop something or is that in the GlobalNpc.cs file as well?
Alright. Thank you for your helpWhat I linked you shows specific drops for DukeFishron. If you are doing a ModNPC you can do that in it's own NPCDrop method.
To add new modded items you'll need to make your own ModItem. Feel free to look at the .cs files inside ExampleMod/Items for examples.Help me, how to make custom ranged weapon and magic weapon?