Agus Admin
Mensajes : 69 Fecha de inscripción : 01/07/2008
| Tema: Codigo de Castillos 0.12.0 Miér Jul 02, 2008 8:59 pm | |
| Declarar esto - Citación :
Public CastilloNorte As String Public CastilloSur As String Public CastilloEste As String Public CastilloOeste As String Public NPCReyCastillo As Integer Public MapaCastilloN As Integer Public MapaCastilloS As Integer Public MapaCastilloE As Integer Public MapaCastilloO As Integer
abajo de - Citación :
BootDelBackUp = val(GetVar(IniPath & "Server.ini", "INIT", "IniciarDesdeBackUp"))
ponerr - Citación :
CastilloNorte = GetVar(App.Path & "\Castillos.ini", "CLANES", "NORTE") CastilloSur = GetVar(App.Path & "\Castillos.ini", "CLANES", "SUR") CastilloEste = GetVar(App.Path & "\Castillos.ini", "CLANES", "ESTE") CastilloOeste = GetVar(App.Path & "\Castillos.ini", "CLANES", "OESTE") NPCReyCastillo = val(GetVar(App.Path & "\Castillos.ini", "REY", "NUMERO")) MapaCastilloN = val(GetVar(App.Path & "\Castillos.ini", "MAPAS", "NORTE")) MapaCastilloS = val(GetVar(App.Path & "\Castillos.ini", "MAPAS", "SUR")) MapaCastilloE = val(GetVar(App.Path & "\Castillos.ini", "MAPAS", "ESTE")) MapaCastilloO = val(GetVar(App.Path & "\Castillos.ini", "MAPAS", "OESTE"))
En el Sub MuereNPC() - Citación :
If MiNpc.Numero = NPCReyCastillo Then Dim Posicion As WorldPos If UserList(UserIndex).Pos.map = MapaCastilloN Then CastilloNorte = modGuilds.GuildName(UserList(UserIndex).guildIndex) Call WriteVar(App.Path & "\Castillos.ini", "CLANES", "NORTE", modGuilds.GuildName(UserList(UserIndex).guildIndex)) Call WriteConsoleMsg(SendTarget.ToAll, "El clan " & modGuilds.GuildName(UserList(UserIndex).guildIndex) & " ah dominado al castillo del norte", FontTypeNames.FONTTYPE_INFOBOLD) End If If UserList(UserIndex).Pos.map = MapaCastilloS Then CastilloSur = modGuilds.GuildName(UserList(UserIndex).guildIndex) Call WriteVar(App.Path & "\Castillos.ini", "CLANES", "SUR", modGuilds.GuildName(UserList(UserIndex).guildIndex)) Call WriteConsoleMsg(SendTarget.ToAll, "El clan " & modGuilds.GuildName(UserList(UserIndex).guildIndex) & " ah dominado al castillo del sur", FontTypeNames.FONTTYPE_INFOBOLD) End If If UserList(UserIndex).Pos.map = MapaCastilloE Then CastilloEste = modGuilds.GuildName(UserList(UserIndex).guildIndex) Call WriteVar(App.Path & "\Castillos.ini", "CLANES", "ESTE", modGuilds.GuildName(UserList(UserIndex).guildIndex)) Call WriteConsoleMsg(SendTarget.ToAll, "El clan " & modGuilds.GuildName(UserList(UserIndex).guildIndex) & " ah dominado al castillo del este", FontTypeNames.FONTTYPE_INFOBOLD) End If If UserList(UserIndex).Pos.map = MapaCastilloO Then CastilloOeste = modGuilds.GuildName(UserList(UserIndex).guildIndex) Call WriteVar(App.Path & "\Castillos.ini", "CLANES", "OESTE", modGuilds.GuildName(UserList(UserIndex).guildIndex)) Call WriteConsoleMsg(SendTarget.ToAll, "El clan " & modGuilds.GuildName(UserList(UserIndex).guildIndex) & " ah dominado al castillo del oeste", FontTypeNames.FONTTYPE_INFOBOLD) End If End If If MiNpc.Numero = NPCReyCastillo Then ' VERIFICO SI ESTOY MATANDO AL REY Call WriteConsoleMsg(SendTarget.ToAll, "El Usuario " & UserList(UserIndex).name & " ha matado al " & MiNpc.name & "", FontTypeNames.FONTTYPE_INFOBOLD) End If
y en el Sub SendMOTD - Citación :
Call WriteConsoleMsg(UserIndex, "El Castillo del Norte esta en manos del clan: " & GetVar(App.Path & "\Castillos.ini", "CLANES", "NORTE"), FontTypeNames.FONTTYPE_INFOBOLD) Call WriteConsoleMsg(UserIndex, "El Castillo del Sur esta en manos del clan: " & GetVar(App.Path & "\Castillos.ini", "CLANES", "SUR"), FontTypeNames.FONTTYPE_INFOBOLD) Call WriteConsoleMsg(UserIndex, "El Castillo del Este esta en manos del clan: " & GetVar(App.Path & "\Castillos.ini", "CLANES", "ESTE"), FontTypeNames.FONTTYPE_INFOBOLD) Call WriteConsoleMsg(UserIndex, "El Castillo del Oeste esta en manos del clan: " & GetVar(App.Path & "\Castillos.ini", "CLANES", "OESTE"), FontTypeNames.FONTTYPE_INFOBOLD)
y el el sub NPCAtacado abajo de - Citación :
Dim EraCriminal As Boolean
ponen - Citación :
If Npclist(NpcIndex).Pos.map = MapaCastilloN And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 10000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 1000 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Norte esta siendo atacado", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloN And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 1000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 0 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Norte esta apunto de caer", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloS And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 10000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 1000 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Sur esta siendo atacado", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloS And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 1000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 0 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Sur esta apunto de caer", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloE And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 10000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 1000 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Este esta siendo atacado", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloE And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 1000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 0 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Este esta apunto de caer", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloO And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 10000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 1000 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Oeste esta siendo atacado", FontTypeNames.FONTTYPE_INFOBOLD) End If If Npclist(NpcIndex).Pos.map = MapaCastilloO And Npclist(NpcIndex).Numero = 925 And Npclist(NpcIndex).Stats.MinHP < 1000 And Npclist(NpcIndex).Stats.MinHP And Npclist(NpcIndex).Stats.MinHP > 0 Then Call WriteConsoleMsg(SendTarget.ToAll, "El castillo del Oeste esta apunto de caer", FontTypeNames.FONTTYPE_INFOBOLD) End If
Solo falta el autorespawm A EL NPC rey esta echo para q tengo 10000 de vida los comandos: SERVERen el Private Enum ClientPacketID poner - Citación :
CastilloNorteN CastilloSurS CastilloEsteE CastilloOesteO
EN EL HandleIncomingData - Citación :
Case ClientPacketID.CastilloNorteN Call HandleNorte(UserIndex) Case ClientPacketID.CastilloSurS Call HandleSur(UserIndex) Case ClientPacketID.CastilloEsteE Call HandleEste(UserIndex) Case ClientPacketID.CastilloOesteO Call HandleOeste(UserIndex)
Y LOS Handle - Citación :
Private Sub HandleNorte(ByVal UserIndex As Integer) Call UserList(UserIndex).incomingData.ReadByte If modGuilds.GuildName(UserList(UserIndex).guildindex) <> GetVar(App.Path & "\Castillos.ini", "CLANES", "NORTE") Then Exit Sub If modGuilds.GuildName(UserList(UserIndex).guildindex) = GetVar(App.Path & "\Castillos.ini", "CLANES", "NORTE") Then Call WarpUserChar(UserIndex, MapaCastilloN, 50, 50, True) Call WriteConsoleMsg(UserIndex, "Has sido llevado al castillo norte.", FontTypeNames.FONTTYPE_INFOBOLD) End If Exit Sub End Sub Private Sub HandleSur(ByVal UserIndex As Integer) Call UserList(UserIndex).incomingData.ReadByte If modGuilds.GuildName(UserList(UserIndex).guildindex) <> GetVar(App.Path & "\Castillos.ini", "CLANES", "SUR") Then Exit Sub If modGuilds.GuildName(UserList(UserIndex).guildindex) = GetVar(App.Path & "\Castillos.ini", "CLANES", "SUR") Then Call WarpUserChar(UserIndex, MapaCastilloS, 50, 50, True) Call WriteConsoleMsg(UserIndex, "Has sido llevado al castillo sur.", FontTypeNames.FONTTYPE_INFOBOLD) End If Exit Sub End Sub Private Sub HandleEste(ByVal UserIndex As Integer) Call UserList(UserIndex).incomingData.ReadByte If modGuilds.GuildName(UserList(UserIndex).guildindex) <> GetVar(App.Path & "\Castillos.ini", "CLANES", "ESTE") Then Exit Sub If modGuilds.GuildName(UserList(UserIndex).guildindex) = GetVar(App.Path & "\Castillos.ini", "CLANES", "ESTE") Then Call WarpUserChar(UserIndex, MapaCastilloE, 50, 50, True) Call WriteConsoleMsg(UserIndex, "Has sido llevado al castillo este.", FontTypeNames.FONTTYPE_INFOBOLD) End If Exit Sub End Sub Private Sub HandleOeste(ByVal UserIndex As Integer) Call UserList(UserIndex).incomingData.ReadByte If modGuilds.GuildName(UserList(UserIndex).guildindex) <> GetVar(App.Path & "\Castillos.ini", "CLANES", "OESTE") Then Exit Sub If modGuilds.GuildName(UserList(UserIndex).guildindex) = GetVar(App.Path & "\Castillos.ini", "CLANES", "OESTE") Then Call WarpUserChar(UserIndex, MapaCastilloO, 50, 50, True) Call WriteConsoleMsg(UserIndex, "Has sido llevado al castillo oeste.", FontTypeNames.FONTTYPE_INFOBOLD) End If Exit Sub End Sub
CLIENTEen el Private Enum ClientPacketID poner - Citación :
CastilloNorteN CastilloSurS CastilloEsteE CastilloOesteO
Los Write - Citación :
Public Sub WriteNorte() Call outgoingData.WriteByte(ClientPacketID.CastilloNorteN) End Sub Public Sub WriteSur() Call outgoingData.WriteByte(ClientPacketID.CastilloSurS) End Sub Public Sub WriteEste() Call outgoingData.WriteByte(ClientPacketID.CastilloEsteE) End Sub Public Sub WriteOeste() Call outgoingData.WriteByte(ClientPacketID.CastilloOesteO) End Sub
En el ParseUserCommand - Citación :
Case "/IRNORTE" Call WriteNorte Case "/IRSUR" Call WriteSur Case "/IRESTE" Call WriteEste Case "/IROESTE" Call WriteOeste
| |
|