Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Evento simple para Source AMZ 97  (Visto 1972 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline bazan Posteado: September 13, 2019, 11:50:24 PM | Modificado: September 14, 2019, 02:23:19 PM by bazan

  • C++ Coder
  • +2 puntos por ventas
  • *
  • Rank: Destacado
  • Posts: 87
  • Gracias recibida: 885
  • ar
Hola amigos aquí les dejo un evento simple que me pidieron para la fuente posteada: http://tuservermu.com.ve/index.php?topic=23395.0



NewEvento.cpp
Code: [Select]
#include "StdAfx.h"
NEWNPC gNpc;


void LOADNEWNPC()
{
gNpc.Switch = GetPrivateProfileIntA("NEWNPC", "SWITCH", NULL, "..\\Aminyuz\\NewNpc.ini");
gNpc.RewardCant = GetPrivateProfileIntA("NEWNPC", "CANTIDAD_PREMIO", NULL, "..\\Aminyuz\\NewNpc.ini");
gNpc.RewardType = GetPrivateProfileIntA("NEWNPC", "TYPE_PREMIO", NULL, "..\\Aminyuz\\NewNpc.ini");
gNpc.RewardIndex = GetPrivateProfileIntA("NEWNPC", "INDEX_PREMIO", NULL, "..\\Aminyuz\\NewNpc.ini");
gNpc.RewardLevel    = GetPrivateProfileIntA("NEWNPC", "LEVEL_PREMIO", NULL, "..\\Aminyuz\\NewNpc.ini");
gNpc.ReqCantidad = GetPrivateProfileIntA("NEWNPC", "CANTIDAD_REQUERIDO", NULL, "..\\Aminyuz\\NewNpc.ini");
}


void CLICKNEWNPC(LPOBJ gObj, LPOBJ gObjNPC, int aIndex)
{
if(gNpc.Switch != 0)
{
NEWNPCs(gObj, gObjNPC,aIndex);
}
else
{
MsgOutput(aIndex,"[NPCNEW]No estoy de servico, vuelva mas tarde.");
}
}

void NEWNPCs(LPOBJ gObj, LPOBJ NpcObj, int aIndex)
{
int REWARD = ITEMGET(gNpc.RewardType,gNpc.RewardIndex);
int RENAID = ITEMGET(14,21);
    if(GetInventoryItemCount(aIndex,RENAID,0) < gNpc.ReqCantidad)
{
MsgOutput(aIndex,"[NPCNEW]No tienes los items Necesarios");
return;
}
for(char x = 0; x < gNpc.RewardCant; x++)
{
ItemSerialCreateSend(aIndex, gObj->MapNumber, gObj->X, gObj->Y,REWARD,gNpc.RewardLevel,0,0,0,0,aIndex,0);
continue;
}
gObjDeleteItemsCount(aIndex, RENAID, 0, gNpc.ReqCantidad);
MsgOutput(aIndex,"[NPCNEW]Premio en el suelo...");
return;
}
NewEvento.h
Code: [Select]
#ifndef NEWNPC_H
#define NEWNPC_H

struct NEWNPC
{
int Switch;
int RewardType;
int RewardIndex;
int RewardCant;
int RewardLevel;
int ReqCantidad;

//char PQuery1[100];
};
extern NEWNPC gNpc;

void LOADNEWNPC();
void CLICKNEWNPC(LPOBJ gObj, LPOBJ gObjNPC, int aIndex);
void NEWNPCs(LPOBJ gObj, LPOBJ NpcObj, int aIndex);

#endif

StdAfx.h
Code: [Select]
#include "NpcNew.h"

Aminyuz.cpp
Code: [Select]
LOADNEWNPC();		// Carga npc new

Txt en: Aminyuz/NewNpc.ini
Code: [Select]
[NEWNPC]

SWITCH = 1 ;// 0 desactivado - 1 Activado
CANTIDAD_PREMIO = 2 ;// Cantidad de premios
TYPE_PREMIO = 14 ;// tipo de item
INDEX_PREMIO = 11 ;// index premio
LEVEL_PREMIO = 12 ; //level de premio
CANTIDAD_REQUERIDO = 5 ;// cantidad de renas requeridas
//// ejemplo. requiere 5 renas, da de premio 2 boxs +5

NPCTalkEx.ccp
Code: [Select]
//==================================
// Archer npc
//====================================
if (gObjNPC->Class == 236)
    {
CLICKNEWNPC(gObj, gObjNPC,gObj->m_Index);

bResult = true;
    }
/* Agregar NPC ARCHER(236) en el monstersetbase /*









Saludos y suerte a todos!

Gracias:


Offline Rescate #1 Posteado: September 14, 2019, 12:31:22 AM | Modificado: September 14, 2019, 01:24:41 AM by rescate02

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 503
  • Gracias recibida: 7281
  • ar

Offline bazan #2 Posteado: September 14, 2019, 02:04:44 AM | Modificado: September 14, 2019, 02:10:10 AM by bazan

  • C++ Coder
  • +2 puntos por ventas
  • *
  • Rank: Destacado
  • Posts: 87
  • Gracias recibida: 885
  • ar
Muy Buen aporte.

@rescate02  ahi modificas el mapa y las coordenadas "gObjTeleport(aIndex,0,125,125);" por las que quieras que se mueva.

Code: [Select]
void NEWNPCs(LPOBJ gObj, LPOBJ NpcObj, int aIndex)
{
  int RENAID = ITEMGET(14,21);
    if(GetInventoryItemCount(aIndex,RENAID,0) < gNpc.ReqCantidad)
{
MsgOutput(aIndex,"[NPCNEW]No tienes los items Necesarios");
return;
}
gObjTeleport(aIndex,0,125,125);
gObjDeleteItemsCount(aIndex, RENAID, 0, gNpc.ReqCantidad);
MsgOutput(aIndex,"[NPCNEW]Movido con exito!");
return;
}

Gracias:


Offline xaxx10 #3 Posteado: September 14, 2019, 01:04:12 PM

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 239
  • Gracias recibida: 6104
  • ar
Groso campeon, exelente aporte

Gracias:


Offline T-LEGENDARY #4 Posteado: September 15, 2019, 12:51:20 PM

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 693
  • Gracias recibida: 8598
  • br
@bazan @xaxx10
AYUDA ME NO ESTOY A CONSEGUIR CONECTAR EL EL SERVIDOR - PASSA ME UNO TURORIAL DE CONFIGURACION
MODIFICACION DEL IP E DEL PASS NECESSITO... :(

Gracias:


Offline xaxx10 #5 Posteado: September 15, 2019, 01:51:32 PM

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 239
  • Gracias recibida: 6104
  • ar
@bazan @xaxx10
AYUDA ME NO ESTOY A CONSEGUIR CONECTAR EL EL SERVIDOR - PASSA ME UNO TURORIAL DE CONFIGURACION
MODIFICACION DEL IP E DEL PASS NECESSITO... :(
no entiendo a lo que te refieres, no logras conectar el gs, con el main?, o no logras poner el nuevo evento simple¿?, trata de sacar un tema de soporte, así no se desvirtúa del tema del mismo.


Offline T-LEGENDARY #6 Posteado: September 15, 2019, 03:01:32 PM

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 693
  • Gracias recibida: 8598
  • br
@bazan @xaxx10
AYUDA ME NO ESTOY A CONSEGUIR CONECTAR EL EL SERVIDOR - PASSA ME UNO TURORIAL DE CONFIGURACION
MODIFICACION DEL IP E DEL PASS NECESSITO... :(
no entiendo a lo que te refieres, no logras conectar el gs, con el main?, o no logras poner el nuevo evento simple¿?, trata de sacar un tema de soporte, así no se desvirtúa del tema del mismo.

error del gs on Conexion.ini no intendo por esto estoy a pedir uno tutorial


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
735 Views
Last post May 10, 2018, 04:54:28 PM
by caron22
2 Replies
2650 Views
Last post December 09, 2018, 10:19:53 PM
by juanka2
5 Replies
1009 Views
Last post October 17, 2019, 05:07:06 PM
by Rescate
3 Replies
2371 Views
Last post July 20, 2020, 06:31:35 PM
by bkduque
0 Replies
181 Views
Last post March 11, 2023, 09:59:42 AM
by Yancarlos