Jump to content

MrSky

Members
  • Content Count

    25
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    MrSky reacted to Dastgir in Bg_monster vs bg_monster   
    You can't use this plugin in 2014 Hercules..
    2014 plugin were having many limitation..
  2. Upvote
    MrSky reacted to AnnieRuru in Bg_monster vs bg_monster   
    I already started writing battleground script since eathena you know ... ?
    https://www.eathena.ws/board/index.php?showtopic=276681
     
    and another
    https://rathena.org/board/topic/91274-about-mob-summoned-by-bg-monster/
     
    battleground monsters NEVER fight each other
    if you want, you have to make source modification ... probably in battle_check_target
     
     
    just to double check
    - script custom_bg#control FAKE_NPC,{OnStart: if ( !getwaitingroomstate( 0, "Attack Team" ) || !getwaitingroomstate( 0, "Defend Team" ) ) end; .atkteam = waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" ); .defteam = waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" ); delwaitingroom "Attack Team"; delwaitingroom "Defend Team"; bg_warp .atkteam, "prontera", 152,187; bg_warp .defteam, "prontera", 160,187; bg_monster .atkteam, "prontera", 155,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; bg_monster .defteam, "prontera", 157,187, "--ja--", BOW_GUARDIAN_, "custom_bg#control::OnEnd"; sleep 10000; // 10 seconds to kill killmonster "prontera", "custom_bg#control::OnEnd"; bg_destroy .atkteam; bg_destroy .defteam; donpcevent "Attack Team::OnInit"; donpcevent "Defend Team::OnInit"; end;OnEnd:// awake strnpcinfo(0); end;}prontera,155,182,5 script Attack Team 1_F_MARIA,{ end;OnInit: waitingroom "ATTACK",2,"custom_bg#control::OnStart",1; end;}prontera,158,182,5 script Defend Team 1_F_MARIA,{ end;OnInit: waitingroom "DEFEND",2,"custom_bg#control::OnStart",1; end;}prontera mapflag battlegroundthis plugin should do it#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "map/mob.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "bgmobattack", // Plugin name SERVER_TYPE_MAP,// Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated)};int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int flag ) { int16 m = target->m; struct block_list *s_bl = src, *t_bl = target; nullpo_ret(src); nullpo_ret(target); if( (t_bl = battle->get_master(target)) == NULL ) t_bl = target; if( (s_bl = battle->get_master(src)) == NULL ) s_bl = src; if ( t_bl->type == BL_MOB && s_bl->type == BL_MOB && map->list[m].flag.battleground ) if ( ((TBL_MOB*)t_bl)->bg_id != ((TBL_MOB*)s_bl)->bg_id ) return 1; return retVal;}HPExport void plugin_init (void) { addHookPost( "battle->check_target", battle_check_target_post );}
  3. Upvote
    MrSky reacted to GmOcean in How to check all items?   
    Like this?
    prontera,154,180,4 script Item Checker 123,{if( !countitem(501) ){ mes "You don't have a Red Potion.";} else { mes "You have a Red Potion, I can tell.";}close;}
  4. Upvote
    MrSky reacted to jaBote in How to check all items?   
    I don't know if this is what you mean, but you can find similar commands by reading the fine manual for this (which is doc/script_commands.txt):
     
    *countitem(<item id>)*countitem("<item name>")This function will return the number of items for the specified item IDthat the invoking character has in the inventory.mes "[Item Checker]";mes "Hmmm, it seems you have "+countitem(502)+" apples";close;Like 'getitem', this function will also accept an 'english name' from thedatabase as an argument.If you want to state the number at the end of a sentence, you can do it byadding up strings:mes "[Item Checker]";mes "Hmmm, the total number of apples you are holding is "+countitem("APPLE");close;  
    Edit: Dang, if you're allowed to have apples only you should check this other function:
    *getinventorylist;This command sets a bunch of arrays with a complete list of whatever the invoking character has in its inventory, including all the data needed to recreate these items perfectly if they are destroyed. Here's what you get:@inventorylist_id[] - array of item ids.@inventorylist_amount[] - their corresponding item amounts.@inventorylist_equip[] - whether the item is equipped or not.@inventorylist_refine[] - for how much it is refined.@inventorylist_identify[] - whether it is identified.@inventorylist_attribute[] - whether it is broken.@inventorylist_card1[] - These four arrays contain card data for the@inventorylist_card2[] items. These data slots are also used to store@inventorylist_card3[] names inscribed on the items, so you can@inventorylist_card4[] explicitly check if the character owns an item made by a specific craftsman.@inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.@inventorylist_count - the number of items in these lists.@inventorylist_bound - whether it is an account bounded item or not.This could be handy to save/restore a character's inventory, since no other command returns such a complete set of data, and could also be theonly way to correctly handle an NPC trader for carded and named items who could resell them - since NPC objects cannot own items, so they have to store item data in variables and recreate the items.Notice that the variables this command generates are all temporary, attached to the character, and integer.Be sure to use @inventorylist_count to go through these arrays, and not 'getarraysize', because the arrays are not automatically cleared between runs of 'getinventorylist'.  
    Just check that @inventorylist_count is 1 and that @inventorylist_id[0] is the Apple item ID.
  5. Upvote
    MrSky reacted to evilpuncker in How to make a timer?   
    use bindcommand feature
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.