Advertisement
Guest User

Code2

a guest
Feb 1st, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using Terraria;
  2. using System;
  3. using System.Diagnostics;
  4. using Microsoft.Xna.Framework;
  5.  
  6. using TAPI;
  7.  
  8. namespace LifeCrystals.Items
  9. {
  10. public class SuspiciousLookingCrystal : ModItem
  11. {
  12. public override bool? UseItem(Player p)
  13. {
  14. if(Main.netMode != 1)
  15. {
  16. //int mX = (int)(Main.screenPosition.X + Main.mouseX);
  17. //int mY = (int)(Main.screenPosition.Y + Main.mouseY);
  18. int npcID = NPC.NewNPC((int)p.Center.X, (int)p.Center.Y - 200, NPCDef.byName["LifeCrystals:Crystal Guardian"].type, 0);
  19. if (Main.netMode == 2)
  20. NetMessage.SendData(23, -1, -1, "", npcID, 0.0f, 0.0f, 0.0f, 0);
  21. }
  22. if(Main.netMode != 2)
  23. {
  24. Main.PlaySound(2, (int)p.Center.X, (int)p.Center.Y, 37);
  25. Vector2 npcPos = p.position - new Vector2(0, 200);
  26. for (int m = 0; m < 15; m++)
  27. {
  28. int dustID = Dust.NewDust(npcPos, p.width, p.height, 60, Main.rand.Next(-10, 10) * 1f, Main.rand.Next(-10, 10) * 1f, 100, Color.White, 3.5f);
  29. Main.dust[dustID].noGravity = true;
  30. }
  31. }
  32. return true;
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement