//Vendor Commission system //v1.4 //by Rudenid //Sphere version: 55i. //Difficulty of Installation: 3/10. //Dependencies: None. //This enables the speech commands "payment", "wage", and "commission" //You must add the line: TSPEECH=playervendor to c_h_vendor and c_h_vendor_f right below their other TSPEECH entries [SPEECH playervendor] ON=*payment* IF !() RETURN 0 ENDIF IF () SAY I am working on a )> percent commission. ELSE SAY I am working on a 50 gold per day wage. ENDIF RETURN 1 ON=*wage* IF !() RETURN 0 ENDIF IF () FINDID.i_vendor_timer.REMOVE SAY I shall now work for a daily wage of 50 gold coins. ELSE SAY I am already working for a daily wage. ENDIF RETURN 1 ON=*commission* IF !() RETURN 0 ENDIF IF () SAY I am already working on commission. ELSE NEWITEM i_vendor_timer ACT.CONT= SAY I am now working on a )> percent commission. ENDIF [ITEMDEF i_vendor_timer] ID=i_memory NAME=Commission Based Vendor Timer TYPE=t_eq_script ON=@Create ATTR=attr_move_never|attr_invis MORE2=85 TIMER=1 ON=@Timer IF !() REMOVE RETURN 1 ENDIF IF !(>) TAG.OLDGOLD=0 ENDIF IF ( = 0) //GM didn't set it explicitly. VAR.OLDACT= CONT.ACT= IF () IF ( = t_multi) IF ( != 93) MORE2=93 CONT.SAY I will now work for a 7% commission. ENDIF ELSEIF ( = t_ship) IF ( != 91) MORE2=91 CONT.SAY I will now work for a 9% commission. ENDIF ENDIF ELSE IF ( != 85) MORE2=85 CONT.SAY I will now work for a 15% commission. ENDIF ENDIF CONT.ACT= VAR.OLDACT= ENDIF IF ( < 51) CONT.FINDLAYER.layer_bankbox.MORE1=+1> TAG.OLDGOLD= ELSE IF (> < ) //If more gold now than before, divide out the commission. VAR.GOLDCHANGE= + >> VAR.GOLDCHANGE= / 100> VAR.GOLDCHANGE= * >> IF !( + > > ) //But don't give them extra gold. CONT.FINDLAYER.layer_bankbox.MORE1= + > ENDIF VAR.GOLDCHANGE= TAG.OLDGOLD= ELSEIF (+51> > ) //If the change is more than 50, set the old amount to the amount held. TAG.OLDGOLD=> ELSE //Otherwise, set the gold held to the old amount instead. CONT.FINDLAYER.layer_bankbox.MORE1=> ENDIF ENDIF TIMER=60 RETURN 1