Jump to content
  • 0

Help >>>> ITEM SCRIPT


Question

Posted (edited)

Need help on this one.

custom bloody branch item script.

i want that:

 

1.If you click bloody branch, box will appear like this (text will be ignored and no monster will be summon)

post-7480-0-37573400-1365223394_thumb.jpg

 

2.Then if you want to summon monsters. example poring ID:1002 it will summoned poring.

post-7480-0-97185200-1365223400_thumb.jpgpost-7480-0-21813000-1365223407_thumb.jpg

 

3. If you replace the 1st number with "9" Large Monster Will be summoned Example Poring ID:1002 replace 1 with 9 then  "9002"

summoned large poring .

post-7480-0-79470800-1365223418_thumb.jpgpost-7480-0-64061600-1365223423_thumb.jpg

 

4 If you use "5" example poring 1002 -> "5002" it summoned small poring.

post-7480-0-70212100-1365223428_thumb.jpgpost-7480-0-34660200-1365223434_thumb.jpg

 

5. If you input number 1 in the box and click okay. All monster that you summon will be disappear

post-7480-0-04301300-1365223413_thumb.jpg

 

 

I need the item script for this.Hope you help me

 

Edited by naaaan

7 answers to this question

Recommended Posts

Posted

monster support the optional parameter of size since r16904 ...update ur svn...

 

 

try 
-    script    Sample    -1,{
OnTalk:
    input .@mob_id;
    if( .@mob_id == 1 ){
        killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill";
        message strcharinfo(0),"All Summoned Mobs killed.";
    }else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){
        message strcharinfo(0),"Invalid Mob ID.";
    }else{
        mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME );
        .@size = select( "Medium Size","Small Size","Large Size" ) - 1;
        close2;
        // monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill";
        monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size;
    }
OnMobKill:
    end;
}
.................{ doevent "Sample::OnTalk"; },{},{}
Posted

Like this ?

-	script	B_branch	-1,{
OnSpawn:
	if( input( .@s$, 1, 5 ) != 0 ) {
		message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring.";
		end;
	}
	else if( atoi( .@s$ ) == 1 ) {
		killmonster strcharinfo(3), strnpcinfo(0) +"::OnMobDead";
		end;
	}
	else if( strmobinfo( 4,atoi( .@s$ ) ) == 0 ) {
		message strcharinfo(0), "Unknown monster.";
		end;
	}
	else if( getstrlen( .@s$ ) > 4 ) {
		while( .@size_m < 3 && strtoupper( charat( .@s$,4 ) ) != .size_typo$[.@size_m] ) .@size_m++;
		if( .@size_m == 3 || atoi( delchar( .@s$,4 ) ) == 0 ) {
			message strcharinfo(0), "Wrong typo.";
			end;
		}
	}
	else if( countitem( .item_id ) < 1 ) {
		message strcharinfo(0), "You need 1 "+ getitemname( .item_id ) +".";
		end;
	}
	monster "this",-1,-1,"--ja--",atoi( .@s$ ),1, strnpcinfo(0) +"::OnMobDead", .@size_m;
	delitem .item_id,1;
	end;
OnInit:
	setarray .size_typo$, "M", "S" ,"L";
	.item_id = 12103;		// Bloody branch ID
OnMobDead:
	end;
}

 

12103,Bloody_Dead_Branch,Bloody Branch,11,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ doevent "B_branch::OnSpawn"; },{},{}

 

 

3. If you replace the 1st number with "9" Large Monster Will be summoned Example Poring ID:1002 replace 1 with 9 then  "9002"

What if you want to summon a mob with ID 2000 ? I change the typo

 

message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring.";

 

 

 

If you input number 1 in the box and click okay. All monster that you summon will be disappear

In my script, all monsters with this label will disappear (all monsters summoned with BB by all players on the map). If you only want to kill the monster summoned by the player, I think you need source modification.

Posted (edited)

try 

-	script	Sample	-1,{
OnTalk:
	input .@mob_id;
	if( .@mob_id == 1 ){
		killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill";
		message strcharinfo(0),"All Summoned Mobs killed.";
	}else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){
		message strcharinfo(0),"Invalid Mob ID.";
	}else{
		mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME );
		.@size = select( "Medium Size","Small Size","Large Size" ) - 1;
		close2;
		// monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill";
		monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size;
	}
OnMobKill:
	end;
}
.................{ doevent "Sample::OnTalk"; },{},{}
Edited by Emistry
Posted (edited)

@capuche i occurred some error how to fix them?

 

[Error]:  Loading NPC file: npc/custom/B_branch.txt
script error on npc/custom/B_branch.txt line 26
    parse_line: need ';'
    21 :        }
    22 :        else if( countitem( .item_id ) < 1 ) {
    23 :                message strcharinfo(0), "You need 1 "+ getitemname( .ite
m_id ) +".";
    24 :                end;
    25 :        }
*   26 :        monster "this",-1,-1,"--ja--",atoi( .@s$ ),1, strnpcinfo(0) +"::
OnMobDead"',' .@size_m;
    27 :        delitem .item_id,1;
    28 :        end;
    29 : OnInit:
    30 :        setarray .size_typo$, "M", "S" ,"L";
    31 :        .item_id = 12103;               // Bloody branch ID

 

And i cant use it. When i click bloody branch nothing happens just recieving this error on my mapserver

[Error]: npc_event: event not found [B_branch::OnSpawn]
[Error]: npc_event: event not found [B_branch::OnSpawn]
[Error]: npc_event: event not found [B_branch::OnSpawn]
[Error]: npc_event: event not found [B_branch::OnSpawn]
[Error]: npc_event: event not found [B_branch::OnSpawn]

 

 

 

@Emistry

Your script too. same error like this. or something that i did wrong...

 

 

How can i fix them? 

thanks..

Edited by naaaan
Posted (edited)

monster support the optional parameter of size since r16904 ...update ur svn...

 

 

try 

-    script    Sample    -1,{
OnTalk:
    input .@mob_id;
    if( .@mob_id == 1 ){
        killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill";
        message strcharinfo(0),"All Summoned Mobs killed.";
    }else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){
        message strcharinfo(0),"Invalid Mob ID.";
    }else{
        mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME );
        .@size = select( "Medium Size","Small Size","Large Size" ) - 1;
        close2;
        // monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill";
        monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size;
    }
OnMobKill:
    end;
}

.................{ doevent "Sample::OnTalk"; },{},{}

oh i use old revision thats why..

and its working now. Thank you for this cool script.

Edited by naaaan

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...