Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Terraria;
- using System;
- using System.Diagnostics;
- using Microsoft.Xna.Framework;
- using TAPI;
- namespace LifeCrystals.Items
- {
- public class Soo : ModItem
- {
- public override bool? UseItem(Player p)
- {
- if(Main.netMode != 1)
- {
- //int mX = (int)(Main.screenPosition.X + Main.mouseX);
- //int mY = (int)(Main.screenPosition.Y + Main.mouseY);
- int npcID = NPC.NewNPC((int)p.Center.X, (int)p.Center.Y - 200, Defs.npcs["LifeCrystals:CrystalGuardian"].type, 0);
- if (Main.netMode == 2)
- NetMessage.SendData(23, -1, -1, "", npcID, 0.0f, 0.0f, 0.0f, 0);
- }
- if(Main.netMode != 2)
- {
- Main.PlaySound(2, (int)p.Center.X, (int)p.Center.Y, 37);
- Vector2 npcPos = p.position - new Vector2(0, 200);
- for (int m = 0; m < 15; m++)
- {
- 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);
- Main.dust[dustID].noGravity = true;
- }
- }
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement